fix: Corrects country code check in statistics filter
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:
Stefan Bethke 2026-11-15 11:36:49 +01:00
commit cdf90a04d3

View file

@ -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'