mirror of
https://github.com/discourse/discourse.git
synced 2025-02-06 11:28:18 +00:00
FIX: URL encoding was not working for %23 in links
This commit is contained in:
parent
c1ddda3e8f
commit
a092944582
@ -1676,7 +1676,7 @@
|
||||
return querypart.replace(/\+/g, " "); // in the query string, a plus and a space are identical
|
||||
});
|
||||
link = decodeURIComponent(link); // unencode first, to prevent double encoding
|
||||
link = encodeURI(link).replace(/'/g, '%27').replace(/\(/g, '%28').replace(/\)/g, '%29');
|
||||
link = encodeURI(link).replace(/#/g, '%23').replace(/'/g, '%27').replace(/\(/g, '%28').replace(/\)/g, '%29');
|
||||
link = link.replace(/\?.*$/, function (querypart) {
|
||||
return querypart.replace(/\+/g, "%2b"); // since we replaced plus with spaces in the query part, all pluses that now appear where originally encoded
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user