Skip to content

Commit

Permalink
Percent decode
Browse files Browse the repository at this point in the history
  • Loading branch information
slowcheetah committed Aug 13, 2024
1 parent 5eaf948 commit a476cc5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/core-js/modules/web.url-search-params.constructor.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ var decode = function (input) {
var decodedChar = charAt(input, i);

if (decodedChar === '%') {
if (input[i + 1] === '%' || i + 1 === length || i + 3 > length) {
if (input[i + 1] === '%' || i + 3 > length) {
result += '%';
i++;
continue;
Expand Down Expand Up @@ -147,12 +147,12 @@ var decode = function (input) {

var nextByte = parseHexOctet(input, i + 1);

if (nextByte > 191 || nextByte < 128) break;

if ($isNaN(nextByte)) {
i += 3;
break;
}
if (nextByte > 191 || nextByte < 128) break;

push(octets, nextByte);
i += 2;
sequenceIndex++;
Expand Down

0 comments on commit a476cc5

Please sign in to comment.