forked from kamba4/sunders
Fix security issues #38
1 changed files with 2 additions and 2 deletions
fix: Corrects country code check in statistics filter
Some checks failed
Build (and tag) Images / build (push) Failing after 12s
Some checks failed
Build (and tag) Images / build (push) Failing after 12s
Operator precedence made the check always true; it now accepts two capital letters or '--' as intended.
commit
cdf90a04d3
|
|
@ -84,8 +84,8 @@
|
|||
} else {
|
||||
$i18n = $i18nCountries;
|
||||
$i18nDefault = $i18nCountriesDefault;
|
||||
// Check if $key consists of 2 capital letters.
|
||||
$key = preg_match('/\b[A-Z]{2}\b/', $valsArray[$i]) === 1 || '--' ? $valsArray[$i] : 'dontfindme';
|
||||
// Check if $key consists of 2 capital letters or is '--' (unknown country).
|
||||
$key = (preg_match('/^[A-Z]{2}$/', $valsArray[$i]) === 1 || $valsArray[$i] === '--') ? $valsArray[$i] : 'dontfindme';
|
||||
}
|
||||
if (!isValidValue($i18n, $i18nDefault, $key)) {
|
||||
// ignore 'vals' and 'cols'
|
||||
|
|
|
|||
Loading…
Reference in a new issue