mirror of
https://github.com/symfony/ux-translator.git
synced 2026-03-24 00:12:19 +01:00
[Translator] Early exit parameters extraction from Intl messages, if no { is found
This commit is contained in:
@@ -23,6 +23,11 @@ final class IntlMessageParametersExtractor implements ExtractorInterface
|
||||
{
|
||||
public function extract(string $message): array
|
||||
{
|
||||
// Early return if there is no parameter-like pattern in the message
|
||||
if (!str_contains($message, '{')) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$parameters = [];
|
||||
|
||||
$intlMessageParser = new IntlMessageParser($message);
|
||||
|
||||
Reference in New Issue
Block a user