mirror of
https://github.com/nodejs/node.git
synced 2025-08-15 13:48:44 +02:00
querystring: manage percent character at unescape
Related: https://github.com/nodejs/node/issues/33892 Fixes: https://github.com/nodejs/node/issues/35012 PR-URL: https://github.com/nodejs/node/pull/35013 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Shingo Inoue <leko.noor@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
This commit is contained in:
parent
07423b5472
commit
3b925219c3
2 changed files with 6 additions and 3 deletions
|
@ -94,13 +94,13 @@ function unescapeBuffer(s, decodeSpaces) {
|
|||
hexHigh = unhexTable[currentChar];
|
||||
if (!(hexHigh >= 0)) {
|
||||
out[outIndex++] = 37; // '%'
|
||||
continue;
|
||||
} else {
|
||||
nextChar = s.charCodeAt(++index);
|
||||
hexLow = unhexTable[nextChar];
|
||||
if (!(hexLow >= 0)) {
|
||||
out[outIndex++] = 37; // '%'
|
||||
out[outIndex++] = currentChar;
|
||||
currentChar = nextChar;
|
||||
index--;
|
||||
} else {
|
||||
hasHex = true;
|
||||
currentChar = hexHigh * 16 + hexLow;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue