update php-urljoin (#867)
This commit is contained in:
parent
717b0bdd9c
commit
e0323f06cd
1 changed files with 9 additions and 0 deletions
9
vendor/php-urljoin/src/urljoin.php
vendored
9
vendor/php-urljoin/src/urljoin.php
vendored
|
@ -26,6 +26,15 @@ function urljoin($base, $rel) {
|
||||||
$pbase = parse_url($base);
|
$pbase = parse_url($base);
|
||||||
$prel = parse_url($rel);
|
$prel = parse_url($rel);
|
||||||
|
|
||||||
|
if ($prel === false || preg_match('/^[a-z0-9\-.]*[^a-z0-9\-.:][a-z0-9\-.]*:/i', $rel)) {
|
||||||
|
/*
|
||||||
|
Either parse_url couldn't parse this, or the original URL
|
||||||
|
fragment had an invalid scheme character before the first :,
|
||||||
|
which can confuse parse_url
|
||||||
|
*/
|
||||||
|
$prel = array('path' => $rel);
|
||||||
|
}
|
||||||
|
|
||||||
if (array_key_exists('path', $pbase) && $pbase['path'] === '/') {
|
if (array_key_exists('path', $pbase) && $pbase['path'] === '/') {
|
||||||
unset($pbase['path']);
|
unset($pbase['path']);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue