forked from kamba4/sunders
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.
This commit is contained in:
parent
3b28280333
commit
cdf90a04d3
1 changed files with 2 additions and 2 deletions
|
|
@ -84,8 +84,8 @@
|
||||||
} else {
|
} else {
|
||||||
$i18n = $i18nCountries;
|
$i18n = $i18nCountries;
|
||||||
$i18nDefault = $i18nCountriesDefault;
|
$i18nDefault = $i18nCountriesDefault;
|
||||||
// Check if $key consists of 2 capital letters.
|
// Check if $key consists of 2 capital letters or is '--' (unknown country).
|
||||||
$key = preg_match('/\b[A-Z]{2}\b/', $valsArray[$i]) === 1 || '--' ? $valsArray[$i] : 'dontfindme';
|
$key = (preg_match('/^[A-Z]{2}$/', $valsArray[$i]) === 1 || $valsArray[$i] === '--') ? $valsArray[$i] : 'dontfindme';
|
||||||
}
|
}
|
||||||
if (!isValidValue($i18n, $i18nDefault, $key)) {
|
if (!isValidValue($i18n, $i18nDefault, $key)) {
|
||||||
// ignore 'vals' and 'cols'
|
// ignore 'vals' and 'cols'
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue