From 32b27e164f34c5007046b66ac2af03b887b1f38d Mon Sep 17 00:00:00 2001 From: Frederik Bosch Date: Mon, 25 Sep 2017 14:17:51 +0200 Subject: [PATCH] use INTL_IDNA_VARIANT_UTS46 instead of INTL_IDNA_VARIANT_2003, which is deprecated in php 7.2 --- src/Dkim/Parameters.php | 4 ++-- src/EmailAddress.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Dkim/Parameters.php b/src/Dkim/Parameters.php index 44e1c353..3da0587d 100644 --- a/src/Dkim/Parameters.php +++ b/src/Dkim/Parameters.php @@ -71,14 +71,14 @@ public function withSignatureExpiration(\DateTimeImmutable $moment): self */ public function newHeaderValue(): HeaderValue { - $selector = idn_to_ascii($this->selector); + $selector = \idn_to_ascii($this->selector, 0, INTL_IDNA_VARIANT_UTS46); // @codeCoverageIgnoreStart if ($selector === false) { throw new \UnexpectedValueException('Cannot encode selector as A-label'); } - $domain = idn_to_ascii($this->domain); + $domain = \idn_to_ascii($this->domain, 0, INTL_IDNA_VARIANT_UTS46); if ($domain === false) { throw new \UnexpectedValueException('Cannot encode domain as A-label'); } diff --git a/src/EmailAddress.php b/src/EmailAddress.php index c5c0989f..4ecac2c1 100644 --- a/src/EmailAddress.php +++ b/src/EmailAddress.php @@ -72,7 +72,7 @@ public function getDomain(): string */ public function getPunyCode(): string { - return $this->localPart . '@' . (\idn_to_ascii($this->domain) ?: $this->domain); + return $this->localPart . '@' . (\idn_to_ascii($this->domain, 0, INTL_IDNA_VARIANT_UTS46) ?: $this->domain); } /**