Skip to content

Commit 6107161

Browse files
committed
URLs: Fixed issue in comparisons when elements missing
1 parent ad283ef commit 6107161

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

app/Util/UrlComparison.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ public function originsMatch(): bool
1818
$aParts = parse_url($this->a);
1919
$bParts = parse_url($this->b);
2020

21-
return $aParts['host'] === $bParts['host']
22-
&& $aParts['scheme'] === $bParts['scheme']
23-
&& $aParts['port'] === $bParts['port'];
21+
return ($aParts['host'] ?? '') === ($bParts['host'] ?? '')
22+
&& ($aParts['scheme'] ?? '') === ($bParts['scheme'] ?? '')
23+
&& ($aParts['port'] ?? '') === ($bParts['port'] ?? '');
2424
}
2525

2626
/**

0 commit comments

Comments
 (0)