Skip to content

Commit 2e69905

Browse files
committed
Fix PHP 8.1 deprecations
1 parent 01b35eb commit 2e69905

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Slugger/AsciiSlugger.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public function slug(string $string, string $separator = '-', string $locale = n
103103
$locale = $locale ?? $this->defaultLocale;
104104

105105
$transliterator = [];
106-
if ('de' === $locale || 0 === strpos($locale, 'de_')) {
106+
if ($locale && ('de' === $locale || 0 === strpos($locale, 'de_'))) {
107107
// Use the shortcut for German in UnicodeString::ascii() if possible (faster and no requirement on intl)
108108
$transliterator = ['de-ASCII'];
109109
} elseif (\function_exists('transliterator_transliterate') && $locale) {

0 commit comments

Comments
 (0)