From 3051c59eff57bb30556604c1a6cec702269e9a30 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Thu, 22 Aug 2019 11:15:28 +0200 Subject: [PATCH] fixed CSC --- src/Symfony/Component/Mime/Address.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Symfony/Component/Mime/Address.php b/src/Symfony/Component/Mime/Address.php index d744aa1dae..b0dcbd0880 100644 --- a/src/Symfony/Component/Mime/Address.php +++ b/src/Symfony/Component/Mime/Address.php @@ -115,9 +115,11 @@ final class Address if (false === strpos($string, '<')) { return new self($string, ''); } + if (!preg_match(self::FROM_STRING_PATTERN, $string, $matches)) { throw new InvalidArgumentException(sprintf('Could not parse "%s" to a "%s" instance.', $string, static::class)); } + return new self($matches['addrSpec'], trim($matches['displayName'], ' \'"')); } }