Skip to content

Commit 23e8071

Browse files
committed
Improve Public Suffix List parsing
1 parent 6752e76 commit 23e8071

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Rules.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -290,18 +290,18 @@ private function getPublicSuffixLengthFromSection(DomainName $domain, string $se
290290
$labelCount = 0;
291291
foreach ($domain->toAscii() as $label) {
292292
//match exception rule
293-
if (isset($rules[$label], $rules[$label]['!'])) {
293+
if (isset($rules[$label]['!'])) {
294294
break;
295295
}
296296

297297
//match wildcard rule
298-
if (isset($rules['*'])) {
298+
if (array_key_exists('*', $rules)) {
299299
++$labelCount;
300300
break;
301301
}
302302

303303
//no match found
304-
if (!isset($rules[$label])) {
304+
if (!array_key_exists($label, $rules)) {
305305
break;
306306
}
307307

0 commit comments

Comments
 (0)