Procházet zdrojové kódy

Potential fix for code scanning alert no. 3: Inefficient regular expression

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
lechibang-1512 před 2 měsíci
rodič
revize
2ebe88d7a2
No account linked to committer's email
1 změnil soubory, kde provedl 2 přidání a 2 odebrání
  1. 2
    2
      sortable.js

+ 2
- 2
sortable.js Zobrazit soubor

@@ -104,9 +104,9 @@ function ts_resortTable(lnk, clid) {
104 104
 	sortfn = ts_sort_caseinsensitive;
105 105
 	if (itm.match(/^\d\d[\/\.-][a-zA-z][a-zA-Z][a-zA-Z][\/\.-]\d\d\d\d$/)) sortfn = ts_sort_date;
106 106
 	if (itm.match(/^\d\d[\/\.-]\d\d[\/\.-]\d\d\d{2}?$/)) sortfn = ts_sort_date;
107
-	if (itm.match(/^-?[£$€Û¢´]\d/)) sortfn = ts_sort_numeric;
107
+	if (itm.match(/^-?[£$€Û¢´]\d/)) sortfn = ts_sort_numeric;
108 108
 	// ignore stuff in () after the numbers.
109
-	if (itm.match(/^-?(\d+[,\.]?)+(E[-+][\d]+)?%?( \(.*\))?$/)) sortfn = ts_sort_numeric;
109
+	if (itm.match(/^-?\d+([,\.]\d+)*(E[-+][\d]+)?%?( \(.*\))?$/)) sortfn = ts_sort_numeric;
110 110
 	SORT_COLUMN_INDEX = column;
111 111
 	var firstRow = new Array();
112 112
 	var newRows = new Array();