8000 fixed encoder in Mime · symfony/symfony@af28965 · GitHub
[go: up one dir, main page]

Skip to content

Commit af28965

Browse files
committed
fixed encoder in Mime
1 parent fc826aa commit af28965

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Symfony/Component/Mime/Address.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,6 @@ public function __construct(string $address)
4040
self::$validator = new EmailValidator();
4141
}
4242

43-
if (null === self::$encoder) {
44-
self::$encoder = new IdnAddressEncoder();
45-
}
46-
4743
if (!self::$validator->isValid($address, new RFCValidation())) {
4844
throw new RfcComplianceException(sprintf('Email "%s" does not comply with addr-spec of RFC 2822.', $address));
4945
}
@@ -58,6 +54,10 @@ public function getAddress(): string
5854

5955
public function getEncodedAddress(): string
6056
{
57+
if (null === self::$encoder) {
58+
self::$encoder = new IdnAddressEncoder();
59+
}
60+
6161
return self::$encoder->encodeString($this->address);
6262
}
6363

0 commit comments

Comments
 (0)
0