This repository has been archived by the owner on Mar 6, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug fix idn_to_uf8 conversion error
- Loading branch information
Showing
12 changed files
with
52 additions
and
12 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
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 |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
* @subpackage League\Uri\PublicSuffix | ||
* @author Ignace Nyamagana Butera <[email protected]> | ||
* @license https://github.com/thephpleague/uri-hostname-parser/blob/master/LICENSE (MIT License) | ||
* @version 1.0.2 | ||
* @version 1.0.3 | ||
* @link https://github.com/thephpleague/uri-hostname-parser | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
|
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 |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
* @subpackage League\Uri\PublicSuffix | ||
* @author Ignace Nyamagana Butera <[email protected]> | ||
* @license https://github.com/thephpleague/uri-hostname-parser/blob/master/LICENSE (MIT License) | ||
* @version 1.0.2 | ||
* @version 1.0.3 | ||
* @link https://github.com/thephpleague/uri-hostname-parser | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
|
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 |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
* @subpackage League\Uri\PublicSuffix | ||
* @author Ignace Nyamagana Butera <[email protected]> | ||
* @license https://github.com/thephpleague/uri-hostname-parser/blob/master/LICENSE (MIT License) | ||
* @version 1.0.2 | ||
* @version 1.0.3 | ||
* @link https://github.com/thephpleague/uri-hostname-parser | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
|
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 |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
* @subpackage League\Uri\PublicSuffix | ||
* @author Ignace Nyamagana Butera <[email protected]> | ||
* @license https://github.com/thephpleague/uri-hostname-parser/blob/master/LICENSE (MIT License) | ||
* @version 1.0.2 | ||
* @version 1.0.3 | ||
* @link https://github.com/thephpleague/uri-hostname-parser | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
|
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 |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
* @subpackage League\Uri\PublicSuffix | ||
* @author Ignace Nyamagana Butera <[email protected]> | ||
* @license https://github.com/thephpleague/uri-hostname-parser/blob/master/LICENSE (MIT License) | ||
* @version 1.0.2 | ||
* @version 1.0.3 | ||
* @link https://github.com/thephpleague/uri-hostname-parser | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
|
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 |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
* @subpackage League\Uri\PublicSuffix | ||
* @author Ignace Nyamagana Butera <[email protected]> | ||
* @license https://github.com/thephpleague/uri-hostname-parser/blob/master/LICENSE (MIT License) | ||
* @version 1.0.2 | ||
* @version 1.0.3 | ||
* @link https://github.com/thephpleague/uri-hostname-parser | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
|
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 |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
* @subpackage League\Uri\PublicSuffix | ||
* @author Ignace Nyamagana Butera <[email protected]> | ||
* @license https://github.com/thephpleague/uri-hostname-parser/blob/master/LICENSE (MIT License) | ||
* @version 1.0.2 | ||
* @version 1.0.3 | ||
* @link https://github.com/thephpleague/uri-hostname-parser | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
|
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 |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
* @subpackage League\Uri\PublicSuffix | ||
* @author Ignace Nyamagana Butera <[email protected]> | ||
* @license https://github.com/thephpleague/uri-hostname-parser/blob/master/LICENSE (MIT License) | ||
* @version 1.0.2 | ||
* @version 1.0.3 | ||
* @link https://github.com/thephpleague/uri-hostname-parser | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
|
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 |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
* @subpackage League\Uri\PublicSuffix | ||
* @author Ignace Nyamagana Butera <[email protected]> | ||
* @license https://github.com/thephpleague/uri-hostname-parser/blob/master/LICENSE (MIT License) | ||
* @version 1.0.2 | ||
* @version 1.0.3 | ||
* @link https://github.com/thephpleague/uri-hostname-parser | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
|
@@ -84,7 +84,16 @@ private function isMatchable($domain): bool | |
*/ | ||
private function normalize(string $domain): string | ||
{ | ||
return strtolower(idn_to_ascii($domain, 0, INTL_IDNA_VARIANT_UTS46)); | ||
if (false !== strpos($domain, '%')) { | ||
$domain = rawurldecode($domain); | ||
} | ||
|
||
$normalize = idn_to_ascii($domain, 0, INTL_IDNA_VARIANT_UTS46); | ||
if (false === $normalize) { | ||
return ''; | ||
} | ||
|
||
return strtolower($normalize); | ||
} | ||
|
||
/** | ||
|
@@ -168,8 +177,12 @@ private function handleNoMatches(string $domain): Domain | |
{ | ||
$labels = explode('.', $domain); | ||
$publicSuffix = array_pop($labels); | ||
if (null !== $publicSuffix && !$this->isPunycoded($domain)) { | ||
|
||
if (!$this->isPunycoded($domain)) { | ||
$publicSuffix = idn_to_utf8($publicSuffix, 0, INTL_IDNA_VARIANT_UTS46); | ||
if (false === $publicSuffix) { | ||
$publicSuffix = null; | ||
} | ||
} | ||
|
||
return new Domain($domain, $publicSuffix); | ||
|
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 |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
* @subpackage League\Uri\PublicSuffix | ||
* @author Ignace Nyamagana Butera <[email protected]> | ||
* @license https://github.com/thephpleague/uri-hostname-parser/blob/master/LICENSE (MIT License) | ||
* @version 1.0.2 | ||
* @version 1.0.3 | ||
* @link https://github.com/thephpleague/uri-hostname-parser | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
|
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