Skip to content

Commit 2ee6df6

Browse files
authored
Merge pull request #2272 from seamuslee001/php81_locale
PHP8.1 Fix issue with passing NULL value for locale into string function
2 parents 82769b9 + 2f93873 commit 2ee6df6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/PhpWord/Style/Language.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ private function validateLocale($locale)
232232
$locale = str_replace('_', '-', $locale);
233233
}
234234

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

0 commit comments

Comments
 (0)