composer update
This commit is contained in:
@@ -11,16 +11,14 @@
|
||||
|
||||
namespace Symfony\Component\Mime\Encoder;
|
||||
|
||||
use Symfony\Component\Mime\Exception\AddressEncoderException;
|
||||
|
||||
/**
|
||||
* An IDN email address encoder.
|
||||
*
|
||||
* Encodes the domain part of an address using IDN. This is compatible will all
|
||||
* SMTP servers.
|
||||
*
|
||||
* This encoder does not support email addresses with non-ASCII characters in
|
||||
* local-part (the substring before @).
|
||||
* Note: It leaves the local part as is. In case there are non-ASCII characters
|
||||
* in the local part then it depends on the SMTP Server if this is supported.
|
||||
*
|
||||
* @author Christian Schmidt
|
||||
*/
|
||||
@@ -28,8 +26,6 @@ final class IdnAddressEncoder implements AddressEncoderInterface
|
||||
{
|
||||
/**
|
||||
* Encodes the domain part of an address using IDN.
|
||||
*
|
||||
* @throws AddressEncoderException If local-part contains non-ASCII characters
|
||||
*/
|
||||
public function encodeString(string $address): string
|
||||
{
|
||||
@@ -38,12 +34,8 @@ final class IdnAddressEncoder implements AddressEncoderInterface
|
||||
$local = substr($address, 0, $i);
|
||||
$domain = substr($address, $i + 1);
|
||||
|
||||
if (preg_match('/[^\x00-\x7F]/', $local)) {
|
||||
throw new AddressEncoderException(sprintf('Non-ASCII characters not supported in local-part os "%s".', $address));
|
||||
}
|
||||
|
||||
if (preg_match('/[^\x00-\x7F]/', $domain)) {
|
||||
$address = sprintf('%s@%s', $local, idn_to_ascii($domain, 0, INTL_IDNA_VARIANT_UTS46));
|
||||
$address = sprintf('%s@%s', $local, idn_to_ascii($domain, 0, \INTL_IDNA_VARIANT_UTS46));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user