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 fc826aa commit af28965Copy full SHA for af28965
src/Symfony/Component/Mime/Address.php
@@ -40,10 +40,6 @@ public function __construct(string $address)
40
self::$validator = new EmailValidator();
41
}
42
43
- if (null === self::$encoder) {
44
- self::$encoder = new IdnAddressEncoder();
45
- }
46
-
47
if (!self::$validator->isValid($address, new RFCValidation())) {
48
throw new RfcComplianceException(sprintf('Email "%s" does not comply with addr-spec of RFC 2822.', $address));
49
@@ -58,6 +54,10 @@ public function getAddress(): string
58
54
59
55
public function getEncodedAddress(): string
60
56
{
57
+ if (null === self::$encoder) {
+ self::$encoder = new IdnAddressEncoder();
+ }
+
61
return self::$encoder->encodeString($this->address);
62
63
0 commit comments