1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 21:15:55 +00:00

bookmarklet: encode URL properly so special characters won't get lost

This commit is contained in:
Andrew Dolgov
2021-02-07 21:09:27 +03:00
parent 41fc03287e
commit c1ad7acfb9

View File

@@ -28,7 +28,7 @@ class Bookmarklets extends Plugin {
$confirm_str = str_replace("'", "\'", __('Subscribe to %s in Tiny Tiny RSS?')); $confirm_str = str_replace("'", "\'", __('Subscribe to %s in Tiny Tiny RSS?'));
$bm_url = htmlspecialchars("javascript:{if(confirm('$confirm_str'.replace('%s',window.location.href)))window.location.href='$bm_subscribe_url'+window.location.href}"); $bm_url = htmlspecialchars("javascript:{if(confirm('$confirm_str'.replace('%s',window.location.href)))window.location.href='$bm_subscribe_url'+encodeURIComponent(window.location.href)}");
print "<p><label class='dijitButton'>"; print "<p><label class='dijitButton'>";
print "<a href=\"$bm_url\">" . __('Subscribe in Tiny Tiny RSS'). "</a>"; print "<a href=\"$bm_url\">" . __('Subscribe in Tiny Tiny RSS'). "</a>";