Skip to content

Commit

Permalink
fix(chore): fix codeql findings
Browse files Browse the repository at this point in the history
Fixes codeql regex findings and fix non fetched multiple htmlentities for ampersand replacements in various modules
  • Loading branch information
lubber-de committed Sep 8, 2022
1 parent 86121ef commit b9dabd5
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/definitions/behaviors/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -1206,8 +1206,8 @@ $.api.settings = {
},

regExp : {
required : /\{\$*[A-z0-9]+\}/g,
optional : /\{\/\$*[A-z0-9]+\}/g,
required : /\{\$*[a-z0-9]+\}/gi,
optional : /\{\/\$*[a-z0-9]+\}/gi,
validate: /^[a-z_][a-z0-9_-]*(?:\[[a-z0-9_-]*\])*$/i,
key: /[a-z0-9_-]+|(?=\[\])/gi,
push: /^$/,
Expand Down
4 changes: 2 additions & 2 deletions src/definitions/modules/dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -3814,7 +3814,7 @@ $.fn.dropdown = function(parameters) {
}
;
if(shouldEscape.test(string)) {
string = string.replace(/&(?![a-z0-9#]{1,6};)/, "&");
string = string.replace(/&(?![a-z0-9#]{1,12};)/gi, "&");
return string.replace(badChars, escapedChar);
}
return string;
Expand Down Expand Up @@ -4251,7 +4251,7 @@ $.fn.dropdown.settings.templates = {
}
;
if(shouldEscape.test(string)) {
string = string.replace(/&(?![a-z0-9#]{1,6};)/, "&");
string = string.replace(/&(?![a-z0-9#]{1,12};)/gi, "&");
return string.replace(badChars, escapedChar);
}
return string;
Expand Down
2 changes: 1 addition & 1 deletion src/definitions/modules/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,7 @@ $.modal = $.fn.modal = function(parameters) {
}
;
if(shouldEscape.test(string)) {
string = string.replace(/&(?![a-z0-9#]{1,6};)/, "&");
string = string.replace(/&(?![a-z0-9#]{1,12};)/gi, "&");
return string.replace(badChars, escapedChar);
}
return string;
Expand Down
2 changes: 1 addition & 1 deletion src/definitions/modules/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -1513,7 +1513,7 @@ $.fn.popup.settings = {
}
;
if(shouldEscape.test(string)) {
string = string.replace(/&(?![a-z0-9#]{1,6};)/, "&");
string = string.replace(/&(?![a-z0-9#]{1,12};)/gi, "&");
return string.replace(badChars, escapedChar);
}
return string;
Expand Down
2 changes: 1 addition & 1 deletion src/definitions/modules/progress.js
Original file line number Diff line number Diff line change
Expand Up @@ -998,7 +998,7 @@ $.fn.progress.settings = {
},

regExp: {
variable: /\{\$*[A-z0-9]+\}/g
variable: /\{\$*[a-z0-9]+\}/gi
},

metadata: {
Expand Down
2 changes: 1 addition & 1 deletion src/definitions/modules/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -1437,7 +1437,7 @@ $.fn.search.settings = {
}
;
if(shouldEscape.test(string)) {
string = string.replace(/&(?![a-z0-9#]{1,6};)/, "&");
string = string.replace(/&(?![a-z0-9#]{1,12};)/gi, "&");
return string.replace(badChars, escapedChar);
}
return string;
Expand Down
2 changes: 1 addition & 1 deletion src/definitions/modules/toast.js
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ $.toast = $.fn.toast = function(parameters) {
}
;
if(shouldEscape.test(string)) {
string = string.replace(/&(?![a-z0-9#]{1,6};)/, "&");
string = string.replace(/&(?![a-z0-9#]{1,12};)/gi, "&");
return string.replace(badChars, escapedChar);
}
return string;
Expand Down

0 comments on commit b9dabd5

Please sign in to comment.