mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-04-13 18:38:48 +00:00
update php-urljoin (#867)
This commit is contained in:
parent
717b0bdd9c
commit
e0323f06cd
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 New Issue
Block a user