Merge pull request #9727 from annando/notice

Fix a notice when the path is empty
This commit is contained in:
Hypolite Petovan 2020-12-31 07:15:12 -05:00 committed by GitHub
commit 422de110e6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1801,6 +1801,7 @@ class Probe
$hrefParts = parse_url($href);
if (!empty($hrefParts['path'])) {
// Root path case (/path) including relative scheme case (//host/path)
if ($hrefParts['path'] && $hrefParts['path'][0] == '/') {
$path = $hrefParts['path'];
@ -1822,6 +1823,7 @@ class Probe
$path = '/' . implode('/', $absolutes);
}
}
// Relative scheme case (//host/path)
$baseParts['host'] = $hrefParts['host'] ?? $baseParts['host'];