Merge pull request #3164 from techAPJ/patch-2
FIX: URL encoding was not working for %23 in links
This commit is contained in:
commit
d9c6acafc0
|
@ -1676,7 +1676,7 @@
|
||||||
return querypart.replace(/\+/g, " "); // in the query string, a plus and a space are identical
|
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 = 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) {
|
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
|
return querypart.replace(/\+/g, "%2b"); // since we replaced plus with spaces in the query part, all pluses that now appear where originally encoded
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue