Merge pull request #2272 from seamuslee001/php81_locale

PHP8.1 Fix issue with passing NULL value for locale into string function
This commit is contained in:
Adrien Crivelli 2022-09-16 00:16:31 +02:00 committed by GitHub
commit 2ee6df65bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -232,7 +232,7 @@ final class Language extends AbstractStyle
$locale = str_replace('_', '-', $locale);
}
if (strlen($locale) === 2) {
if ($locale !== null && strlen($locale) === 2) {
return strtolower($locale) . '-' . strtoupper($locale);
}