Merge pull request #3164 from techAPJ/patch-2

FIX: URL encoding was not working for %23 in links
This commit is contained in:
Robin Ward 2015-02-03 11:39:40 -05:00
commit d9c6acafc0
1 changed files with 1 additions and 1 deletions

View File

@ -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
});