Ensure language redirect conditions do not match for too low quality accepted languages

This commit is contained in:
Alejandro Celaya
2024-03-07 10:03:11 +01:00
parent 0bc7412430
commit be8cf56240
5 changed files with 37 additions and 13 deletions

View File

@@ -77,7 +77,7 @@ class RedirectCondition extends AbstractEntity implements JsonSerializable
return false;
}
$acceptedLanguages = acceptLanguageToLocales($acceptLanguage);
$acceptedLanguages = acceptLanguageToLocales($acceptLanguage, minQuality: 0.9);
[$matchLanguage, $matchCountryCode] = splitLocale(normalizeLocale($this->matchValue));
return some(