PHP8.1 Fix issue with passing NULL value for locale into string function

This commit is contained in:
Seamus Lee 2022-07-30 07:28:01 +00:00
parent 4dc34d43d8
commit 2f93873a7c
1 changed files with 1 additions and 1 deletions

View File

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