Skip to content

Commit 6d0878a

Browse files
committed
Adding information about 6.4 cache refresh requirement
1 parent fdec722 commit 6d0878a

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,14 @@ All Notable changes to `PHP Domain Parser` starting from the **5.x** series will
77
### Added
88

99
- `DomainName::withRootLabel`, `DomainName::withoutRootLabel`, `DomainName::isAbsolute` methods to handle absolute domain names.
10+
- `DomainName::when` to allow conditionable when building the domain.
1011

1112
### Fixed
1213

1314
- Absolute domain name can now also be resolved by the package see issue [#361](https://github.com/jeremykendall/php-domain-parser/issues/361) prior to this release an exception was thrown.
1415
- Since we no longer support PHP7 type hint and return type are improved.
16+
- Resolving private suffixes that have a wildcarded subdomain suffix [#363](https://github.com/jeremykendall/php-domain-parser/issues/363) by [@wikando-ck](https://github.com/wikando-ck)
17+
(Once downloaded and installed you MUST refresh your cache to enable the fix to work.)
1518

1619
### Deprecated
1720

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ a polyfill for the `intl` IDN functions like the `symfony/polyfill-intl-idn`
4444
otherwise an exception will be thrown when attempting to validate or interact
4545
with such a host.
4646

47+
> [!WARNING]
48+
> When upgrading to version `6.4` you MUST refresh your local cache for the fix on
49+
> private domain resolution to take effect.
50+
4751
## Usage
4852

4953
> [!WARNING]

src/Rules.php

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -273,13 +273,20 @@ private function getPublicSuffixLengthFromSection(DomainName $domain, string $se
273273

274274
//no match found
275275
if (!array_key_exists($label, $rules)) {
276-
// Suffix MUST be fully matched else no suffix is found for private domain
277-
if (self::PRIVATE_DOMAINS === $section && array_key_exists(self::DOMAIN_RULE_MARKER, $rules)) {
276+
if (self::PRIVATE_DOMAINS !== $section) {
277+
break;
278+
}
279+
280+
// Suffix MATCHES default domain
281+
if (array_key_exists(self::DOMAIN_RULE_MARKER, $rules)) {
278282
return $labelCount;
279283
}
280-
if (self::PRIVATE_DOMAINS === $section && self::hasRemainingRules($rules)) {
281-
$labelCount = 0;
284+
285+
// Suffix MUST be fully matched else no suffix is found for private domain
286+
if (self::hasRemainingRules($rules)) {
287+
return 0;
282288
}
289+
283290
break;
284291
}
285292

0 commit comments

Comments
 (0)