We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9572918 commit 537c39bCopy full SHA for 537c39b
src/Symfony/Component/Translation/Translator.php
@@ -308,7 +308,7 @@ protected function computeFallbackLocales($locale)
308
*/
309
private function assertValidLocale($locale)
310
{
311
- if (0 !== preg_match('/[^a-z0-9@_\\.\\-]+/i', $locale, $match)) {
+ if (1 !== preg_match('/^[a-z0-9@_\\.\\-]*$/i', $locale)) {
312
throw new \InvalidArgumentException(sprintf('Invalid locale: %s.', $locale));
313
}
314
0 commit comments