Skip to content

Commit

Permalink
use INTL_IDNA_VARIANT_UTS46 instead of INTL_IDNA_VARIANT_2003, which is
Browse files Browse the repository at this point in the history
deprecated in php 7.2
  • Loading branch information
frederikbosch committed Sep 25, 2017
1 parent 1469eb4 commit 32b27e1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Dkim/Parameters.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
Expand Down
2 changes: 1 addition & 1 deletion src/EmailAddress.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand Down

0 comments on commit 32b27e1

Please sign in to comment.