Merge pull request #304 from antville/fix-codeql-js-incomplete-sanitization
Fix CodeQL issue js/incomplete-sanitization
This commit is contained in:
commit
8f8a5fa341
2 changed files with 2 additions and 2 deletions
|
@ -1077,7 +1077,7 @@ function validateUrl(str) {
|
|||
function quote(str, pattern) {
|
||||
str = String(str);
|
||||
if (!pattern || RegExp(pattern).test(str) || /['"]/.test(str)) {
|
||||
str = "'" + str.replace(/("|')/g, '\\$1') + "'";
|
||||
str = "'" + str.replace(/('|"|\\)/g, '\\$1') + "'";
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
|
|
@ -574,7 +574,7 @@ convert.skins = function() {
|
|||
}
|
||||
if (parent !== null && parent !== undefined) {
|
||||
execute("update skin set source = '" +
|
||||
clean(parent).replace(/'/g, "\\'") + "' where " +
|
||||
clean(parent).replace(/('|\\)/g, "\\$1") + "' where " +
|
||||
'id = ' + this.id);
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue