Skip to content

Commit

Permalink
Merge pull request #2272 from seamuslee001/php81_locale
Browse files Browse the repository at this point in the history
PHP8.1 Fix issue with passing NULL value for locale into string function
  • Loading branch information
PowerKiKi committed Sep 15, 2022
2 parents 82769b9 + 2f93873 commit 2ee6df6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/PhpWord/Style/Language.php
Expand Up @@ -232,7 +232,7 @@ private function validateLocale($locale)
$locale = str_replace('_', '-', $locale);
}

if (strlen($locale) === 2) {
if ($locale !== null && strlen($locale) === 2) {
return strtolower($locale) . '-' . strtoupper($locale);
}

Expand Down

0 comments on commit 2ee6df6

Please sign in to comment.