Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
hash_util: Encode url component derived from browser.
Aman Agrawal64020c2358b2
diff --git a/frontend_tests/node_tests/hash_util.js b/frontend_tests/node_tests/hash_util.jsindex 8d3f36e1638..6813e8d4208 100644--- a/frontend_tests/node_tests/hash_util.js+++ b/frontend_tests/node_tests/hash_util.js@@ -208,5 +208,5 @@ run_test("test_search_public_streams_notice_url", () => {run_test("test_current_hash_as_next", () => {window.location.hash = "#foo";- assert.equal(hash_util.current_hash_as_next(), "next=/#foo");+ assert.equal(hash_util.current_hash_as_next(), "next=/%23foo");});diff --git a/static/js/hash_util.js b/static/js/hash_util.jsindex 6b99cc524f8..623707c1b62 100644--- a/static/js/hash_util.js+++ b/static/js/hash_util.js@@ -310,5 +310,5 @@ export function is_spectator_compatible(hash) {}export function current_hash_as_next() {- return `next=/${window.location.hash}`;+ return `next=/${encodeURIComponent(window.location.hash)}`;}