Skip to content

Commit 826b2bc

Browse files
Fix code scanning alerts (#2006)
* Fix code scanning alert no. 87: Bad HTML filtering regexp (#2001) Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> * Fix code scanning alert no. 86: Bad HTML filtering regexp (#2002) Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> * Fix code scanning alert no. 90: Replacement of a substring with itself (#2003) * Fix code scanning alert no. 90: Replacement of a substring with itself Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> * Update 15utility.js --------- Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> * Fix code scanning alert no. 35: Incomplete string escaping or encoding (#2005) * Fix code scanning alert no. 34: Incomplete string escaping or encoding (#2004) Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> * Fix code scanning alert no. 35: Incomplete string escaping or encoding Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --------- Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --------- Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent 1296bdc commit 826b2bc

File tree

4 files changed

+7
-8
lines changed

4 files changed

+7
-8
lines changed

modules/xlsx/dist/xlsx.extendscript.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21698,7 +21698,7 @@ function html_to_sheet(str, _opts) {
2169821698
var opts = _opts || {};
2169921699
var dense = (opts.dense != null) ? opts.dense : DENSE;
2170021700
var ws = ({}); if(dense) ws["!data"] = [];
21701-
str = str.replace(/<!--.*?-->/g, "");
21701+
str = str.replace(/<!--[\s\S]*?-->/g, "");
2170221702
var mtch = str.match(/<table/i);
2170321703
if(!mtch) throw new Error("Invalid HTML: could not find <table>");
2170421704
var mtch2 = str.match(/<\/table/i);

modules/xlsx/xlsx.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21647,7 +21647,7 @@ function html_to_sheet(str/*:string*/, _opts)/*:Workbook*/ {
2164721647
var opts = _opts || {};
2164821648
var dense = (opts.dense != null) ? opts.dense : DENSE;
2164921649
var ws/*:Worksheet*/ = ({}/*:any*/); if(dense) ws["!data"] = [];
21650-
str = str.replace(/<!--.*?-->/g, "");
21650+
str = str.replace(/<!--[\s\S]*?-->/g, "");
2165121651
var mtch/*:any*/ = str.match(/<table/i);
2165221652
if(!mtch) throw new Error("Invalid HTML: could not find <table>");
2165321653
var mtch2/*:any*/ = str.match(/<\/table/i);

src/15utility.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -124,15 +124,14 @@ var doubleq = (utils.doubleq = function (s) {
124124
});
125125

126126
/**
127-
Replace sigle quote to escaped single quote
127+
Replace single quote with escaped single quote
128128
@param {string} s Source string
129129
@return {string} Replaced string
130130
131-
@todo Chack this functions
132-
133-
*/
131+
@todo Check this function
132+
*/
134133
var doubleqq = (utils.doubleqq = function (s) {
135-
return s.replace(/\'/g, "'");
134+
return s.replace(/'/g, "\\'");
136135
});
137136

138137
/**

test/test376.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ SELECT ASCII('ÿ'); -- 255 - Latin small letter y with diaeresis
239239
tests = (/\/\*([\S\s]+)\*\//m.exec(tests) || ['', ''])[1];
240240

241241
tests
242-
.replace('\r', '')
242+
.replace(/\r/g, '')
243243
.trim()
244244
.split('\n')
245245
.forEach(function (test) {

0 commit comments

Comments
 (0)