mirror of https://github.com/zulip/zulip.git
hash_util: Encode url component derived from browser.
This is for security reasons.
This commit is contained in:
parent
7713b371a5
commit
64020c2358
|
@ -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");
|
||||
});
|
||||
|
|
|
@ -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)}`;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue