File tree Expand file tree Collapse file tree 2 files changed +2
-9
lines changed
src/Symfony/Component/Intl Expand file tree Collapse file tree 2 files changed +2
-9
lines changed Original file line number Diff line number Diff line change @@ -68,13 +68,7 @@ public static function getDefaultFallback(): ?string
68
68
public static function getFallback (string $ locale ): ?string
69
69
{
70
70
if (\function_exists ('locale_parse ' )) {
71
- if (null === $ localeSubTags = locale_parse ($ locale )) {
72
- if (\defined ('INTL_MAX_LOCALE_LEN ' )) {
73
- $ message = sprintf ('The length of $locale must be less than %s ' , \INTL_MAX_LOCALE_LEN );
74
- }
75
-
76
- throw new \InvalidArgumentException ($ message ?? '' );
77
- }
71
+ $ localeSubTags = locale_parse ($ locale ) ?? ['language ' => $ locale ];
78
72
79
73
if (1 === \count ($ localeSubTags )) {
80
74
if ('root ' !== self ::$ defaultFallback && self ::$ defaultFallback === $ localeSubTags ['language ' ]) {
Original file line number Diff line number Diff line change @@ -80,7 +80,6 @@ public function testLongLocaleFallback()
80
80
'LC_MONETARY=fr_FR.UTF-8;LC_MESSAGES=fr_FR.UTF-8;LC_PAPER=fr_FR.UTF-8;LC_NAME=fr_FR.UTF-8; ' .
81
81
'LC_ADDRESS=fr_FR.UTF-8;LC_TELEPHONE=fr_FR.UTF-8;LC_MEASUREMENT=fr_FR.UTF-8;LC_IDENTIFICATION=fr_FR.UTF-8 ' ;
82
82
83
- $ this ->expectException (\InvalidArgumentException::class);
84
- Locale::getFallback ($ locale );
83
+ $ this ->assertNull (Locale::getFallback ($ locale ));
85
84
}
86
85
}
You can’t perform that action at this time.
0 commit comments