Skip to content

Commit 37c15e6

Browse files
author
Ernestas Staugaitis
committed
Some document have non-standard locale code
1 parent a0e5745 commit 37c15e6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/PhpWord/Style/Language.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,9 @@ public function getBidirectional()
228228
*/
229229
private function validateLocale($locale)
230230
{
231-
$locale = str_replace('_', '-', $locale);
231+
if ($locale !== null) {
232+
$locale = str_replace('_', '-', $locale);
233+
}
232234

233235
if (strlen($locale) === 2) {
234236
return strtolower($locale) . '-' . strtoupper($locale);

0 commit comments

Comments
 (0)