Skip to content
This repository has been archived by the owner on Mar 6, 2021. It is now read-only.

Commit

Permalink
release 1.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
nyamsprod committed Nov 30, 2017
1 parent 77048a7 commit c475caa
Show file tree
Hide file tree
Showing 13 changed files with 40 additions and 15 deletions.
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,24 @@

All Notable changes to `League Uri Nostname parser` will be documented in this file

## 1.0.4 - 2017-11-30

### Added

- None

### Fixed

- Domain class with invalid domain names

### Deprecated

- None

### Removed

- None

## 1.0.3 - 2017-11-30

### Added
Expand Down
2 changes: 1 addition & 1 deletion src/Installer/ICANNSection.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @subpackage League\Uri\PublicSuffix
* @author Ignace Nyamagana Butera <nyamsprod@gmail.com>
* @license https://github.com/thephpleague/uri-hostname-parser/blob/master/LICENSE (MIT License)
* @version 1.0.3
* @version 1.0.4
* @link https://github.com/thephpleague/uri-hostname-parser
*
* For the full copyright and license information, please view the LICENSE
Expand Down
2 changes: 1 addition & 1 deletion src/PublicSuffix/Cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @subpackage League\Uri\PublicSuffix
* @author Ignace Nyamagana Butera <nyamsprod@gmail.com>
* @license https://github.com/thephpleague/uri-hostname-parser/blob/master/LICENSE (MIT License)
* @version 1.0.3
* @version 1.0.4
* @link https://github.com/thephpleague/uri-hostname-parser
*
* For the full copyright and license information, please view the LICENSE
Expand Down
2 changes: 1 addition & 1 deletion src/PublicSuffix/CacheException.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @subpackage League\Uri\PublicSuffix
* @author Ignace Nyamagana Butera <nyamsprod@gmail.com>
* @license https://github.com/thephpleague/uri-hostname-parser/blob/master/LICENSE (MIT License)
* @version 1.0.3
* @version 1.0.4
* @link https://github.com/thephpleague/uri-hostname-parser
*
* For the full copyright and license information, please view the LICENSE
Expand Down
2 changes: 1 addition & 1 deletion src/PublicSuffix/CurlHttpClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @subpackage League\Uri\PublicSuffix
* @author Ignace Nyamagana Butera <nyamsprod@gmail.com>
* @license https://github.com/thephpleague/uri-hostname-parser/blob/master/LICENSE (MIT License)
* @version 1.0.3
* @version 1.0.4
* @link https://github.com/thephpleague/uri-hostname-parser
*
* For the full copyright and license information, please view the LICENSE
Expand Down
16 changes: 11 additions & 5 deletions src/PublicSuffix/Domain.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @subpackage League\Uri\PublicSuffix
* @author Ignace Nyamagana Butera <nyamsprod@gmail.com>
* @license https://github.com/thephpleague/uri-hostname-parser/blob/master/LICENSE (MIT License)
* @version 1.0.3
* @version 1.0.4
* @link https://github.com/thephpleague/uri-hostname-parser
*
* For the full copyright and license information, please view the LICENSE
Expand Down Expand Up @@ -128,15 +128,21 @@ private function hasRegistrableDomain(): bool
*
* @param string $domain
*
* @return string
* @return string|null
*/
private function normalize(string $domain): string
private function normalize(string $domain)
{
$func = 'idn_to_utf8';
if (strpos($domain, 'xn--') !== false) {
return strtolower(idn_to_ascii($domain, 0, INTL_IDNA_VARIANT_UTS46));
$func = 'idn_to_ascii';
}

$domain = $func($domain, 0, INTL_IDNA_VARIANT_UTS46);
if (false === $domain) {
return null;
}

return idn_to_utf8($domain, 0, INTL_IDNA_VARIANT_UTS46);
return strtolower($domain);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/PublicSuffix/Exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @subpackage League\Uri\PublicSuffix
* @author Ignace Nyamagana Butera <nyamsprod@gmail.com>
* @license https://github.com/thephpleague/uri-hostname-parser/blob/master/LICENSE (MIT License)
* @version 1.0.3
* @version 1.0.4
* @link https://github.com/thephpleague/uri-hostname-parser
*
* For the full copyright and license information, please view the LICENSE
Expand Down
2 changes: 1 addition & 1 deletion src/PublicSuffix/HttpClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @subpackage League\Uri\PublicSuffix
* @author Ignace Nyamagana Butera <nyamsprod@gmail.com>
* @license https://github.com/thephpleague/uri-hostname-parser/blob/master/LICENSE (MIT License)
* @version 1.0.3
* @version 1.0.4
* @link https://github.com/thephpleague/uri-hostname-parser
*
* For the full copyright and license information, please view the LICENSE
Expand Down
2 changes: 1 addition & 1 deletion src/PublicSuffix/HttpClientException.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @subpackage League\Uri\PublicSuffix
* @author Ignace Nyamagana Butera <nyamsprod@gmail.com>
* @license https://github.com/thephpleague/uri-hostname-parser/blob/master/LICENSE (MIT License)
* @version 1.0.3
* @version 1.0.4
* @link https://github.com/thephpleague/uri-hostname-parser
*
* For the full copyright and license information, please view the LICENSE
Expand Down
2 changes: 1 addition & 1 deletion src/PublicSuffix/ICANNSectionManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @subpackage League\Uri\PublicSuffix
* @author Ignace Nyamagana Butera <nyamsprod@gmail.com>
* @license https://github.com/thephpleague/uri-hostname-parser/blob/master/LICENSE (MIT License)
* @version 1.0.3
* @version 1.0.4
* @link https://github.com/thephpleague/uri-hostname-parser
*
* For the full copyright and license information, please view the LICENSE
Expand Down
2 changes: 1 addition & 1 deletion src/PublicSuffix/Rules.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @subpackage League\Uri\PublicSuffix
* @author Ignace Nyamagana Butera <nyamsprod@gmail.com>
* @license https://github.com/thephpleague/uri-hostname-parser/blob/master/LICENSE (MIT License)
* @version 1.0.3
* @version 1.0.4
* @link https://github.com/thephpleague/uri-hostname-parser
*
* For the full copyright and license information, please view the LICENSE
Expand Down
2 changes: 1 addition & 1 deletion src/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @subpackage League\Uri\PublicSuffix
* @author Ignace Nyamagana Butera <nyamsprod@gmail.com>
* @license https://github.com/thephpleague/uri-hostname-parser/blob/master/LICENSE (MIT License)
* @version 1.0.3
* @version 1.0.4
* @link https://github.com/thephpleague/uri-hostname-parser
*
* For the full copyright and license information, please view the LICENSE
Expand Down
1 change: 1 addition & 0 deletions tests/DomainTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public function invalidRegistrableDomainProvider()
'domain and suffix are the same' => ['co.uk', 'co.uk'],
'domain has no labels' => ['faketld', 'faketld'],
'public suffix is null' => ['faketld', null],
'public suffix is invalid' => ['_b%C3%A9bé.be-', 'be-'],
];
}
}

0 comments on commit c475caa

Please sign in to comment.