Skip to content

Commit 9f6d130

Browse files
Implement proper URI encoding on search query
1 parent 95dcf4e commit 9f6d130

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

script.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ function searchRedirect(e) {
6767
(network_toggles[3] ? peertube_query : "");
6868

6969
if (preferred_engine === "google_acc")
70-
window.location.href = `https://www.google.com/search?q=${search_query}+(${nlist_query})`;
70+
window.location.href = `https://www.google.com/search?q=${encodeURIComponent(search_query)}+(${nlist_query})`;
7171
} else
72-
window.location.href = `${search_engine}${search_query}+(site%3Apixelfed.social+OR+site%3Amastodon.social+OR+site%3Amstdn.social+OR+site%3Alemmy.world+OR+site%3Alemm.ee+OR+site%3Ash.itjust.works+OR+site%3Ahexbear.net+OR+site%3Alemmy.dbzer0.com+OR+site%3Afeddit.org+OR+site%3Afedia.io+OR+site%3Apixelfed.social+OR+site%3Apixelfed.de+OR+site%3Amisskey.io+OR+site%3Aphijkchu.com+OR+site%3Aloops.video)`;
72+
window.location.href = `${search_engine}${encodeURIComponent(search_query)}+(site%3Apixelfed.social+OR+site%3Amastodon.social+OR+site%3Amstdn.social+OR+site%3Alemmy.world+OR+site%3Alemm.ee+OR+site%3Ash.itjust.works+OR+site%3Ahexbear.net+OR+site%3Alemmy.dbzer0.com+OR+site%3Afeddit.org+OR+site%3Afedia.io+OR+site%3Apixelfed.social+OR+site%3Apixelfed.de+OR+site%3Amisskey.io+OR+site%3Aphijkchu.com+OR+site%3Aloops.video)`;
7373
sessionStorage.setItem("searchQuery", search_query);
7474
}
7575

0 commit comments

Comments
 (0)