-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
zendframework/zend-mail/fix-idn_to_ascii-deprecation-warning.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
From: Filippo Tessarotto <zoeslam@gmail.com> | ||
Date: Fri, 29 Dec 2017 16:30:07 +0100 | ||
Subject: [PATCH] Fix idn_to_ascii deprecation warning | ||
|
||
--- a/src/Header/AbstractAddressList.php | ||
+++ b/src/Header/AbstractAddressList.php | ||
@@ -102,6 +102,9 @@ public function getFieldName() | ||
protected function idnToAscii($domainName) | ||
{ | ||
if (extension_loaded('intl')) { | ||
+ if (defined('INTL_IDNA_VARIANT_UTS46')) { | ||
+ return (idn_to_ascii($domainName, 0, INTL_IDNA_VARIANT_UTS46) ?: $domainName); | ||
+ } | ||
return (idn_to_ascii($domainName) ?: $domainName); | ||
} | ||
return $domainName; |
31 changes: 31 additions & 0 deletions
31
zendframework/zend-validator/fix-idn_to_-deprecation-warning.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
From: Michele Locati <michele@locati.it> | ||
Date: Wed, 29 May 2019 18:26:58 +0200 | ||
Subject: [PATCH] Fix idn_to_ascii/idn_to_utf8 deprecation warning | ||
|
||
Fix the "INTL_IDNA_VARIANT_2003 is deprecated" warning | ||
|
||
Co-Authored-By: Filippo Tessarotto <zoeslam@gmail.com> | ||
Co-Authored-By: Abdul Malik Ikhsan <samsonasik@gmail.com> | ||
|
||
--- a/src/EmailAddress.php | ||
+++ b/src/EmailAddress.php | ||
@@ -535,6 +535,9 @@ class EmailAddress extends AbstractValidator | ||
protected function idnToAscii($email) | ||
{ | ||
if (extension_loaded('intl')) { | ||
+ if (defined('INTL_IDNA_VARIANT_UTS46')) { | ||
+ return (idn_to_ascii($email, 0, INTL_IDNA_VARIANT_UTS46) ?: $email); | ||
+ } | ||
return (idn_to_ascii($email) ?: $email); | ||
} | ||
return $email; | ||
@@ -554,6 +557,9 @@ class EmailAddress extends AbstractValidator | ||
// the source string in those cases. | ||
// But not when the source string is long enough. | ||
// Thus we default to source string ourselves. | ||
+ if (defined('INTL_IDNA_VARIANT_UTS46')) { | ||
+ return idn_to_utf8($email, 0, INTL_IDNA_VARIANT_UTS46) ?: $email; | ||
+ } | ||
return idn_to_utf8($email) ?: $email; | ||
} | ||
return $email; |