Skip to content

Commit

Permalink
Only check for substring once
Browse files Browse the repository at this point in the history
  • Loading branch information
dstillman committed Aug 5, 2024
1 parent b634347 commit c7b216e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion utilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,8 @@ var Utilities = {
x = decodeURIComponent(x);
}
// Even if it's not a URL decode %3C followed by %3E as < >
if (x.indexOf("%3C") < x.indexOf("%3E") && x.indexOf("%3C") >= 0) {
var openingPos = x.indexOf("%3C");
if (openingPos != -1 && openingPos < x.indexOf("%3E")) {
x = x.replace(/%3C/g, "<");
x = x.replace(/%3E/g, ">");
}
Expand Down

0 comments on commit c7b216e

Please sign in to comment.