diff --git a/src/Illuminate/Support/Str.php b/src/Illuminate/Support/Str.php index eb1d94e7d0de..ab7307ac41e5 100644 --- a/src/Illuminate/Support/Str.php +++ b/src/Illuminate/Support/Str.php @@ -57,7 +57,7 @@ public static function ascii($value, $language = 'en') $languageSpecific = static::languageSpecificCharsArray($language); if (! is_null($languageSpecific)) { - $value = str_replace($languageSpecific[0], $languageSpecific[1], $value); + $value = str_replace(array_keys($languageSpecific), array_values($languageSpecific), $value); } foreach (static::charsArray() as $key => $val) { @@ -703,12 +703,22 @@ protected static function languageSpecificCharsArray($language) if (! isset($languageSpecific)) { $languageSpecific = [ 'bg' => [ - ['х', 'Х', 'щ', 'Щ', 'ъ', 'Ъ', 'ь', 'Ь'], - ['h', 'H', 'sht', 'SHT', 'a', 'А', 'y', 'Y'], + 'х' => 'h', + 'Х' => 'H', + 'щ' => 'sht', + 'Щ' => 'SHT', + 'ъ' => 'a', + 'Ъ' => 'А', + 'ь' => 'y', + 'Ь' => 'Y', ], 'de' => [ - ['ä', 'ö', 'ü', 'Ä', 'Ö', 'Ü'], - ['ae', 'oe', 'ue', 'AE', 'OE', 'UE'], + 'ä' => 'ae', + 'ö' => 'oe', + 'ü' => 'ue', + 'Ä' => 'AE', + 'Ö' => 'OE', + 'Ü' => 'UE', ], ]; }