From cc8ade35b95f4951f7f1e6925e9fa8c4f33ea04c Mon Sep 17 00:00:00 2001 From: Gabriele Musco Date: Mon, 28 Jun 2021 11:08:31 +0200 Subject: [PATCH] share on fediverse: minimal checks on instance url --- layouts/partials/share_on_fediverse.html | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/layouts/partials/share_on_fediverse.html b/layouts/partials/share_on_fediverse.html index 5f17b31..8863f15 100644 --- a/layouts/partials/share_on_fediverse.html +++ b/layouts/partials/share_on_fediverse.html @@ -28,11 +28,16 @@ return 'https://' + url; } function shareOnFedi() { - let instance = fixURL(fediInstanceInput.value); + let instance = fediInstanceInput.value.trim(); + if (!instance) { + return; + } + instance = fixURL(instance); window.open( `${instance}/share?text=${articleTitle}%20${articleLink}`, '__blank' ); + closeFediInstanceDialog(); } {{ end }}