mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-20 13:41:30 +00:00
rewrite_relative_url: validate resulting absolutized URLs
This commit is contained in:
@@ -1526,10 +1526,10 @@
|
|||||||
$rel_parts = parse_url($rel_url);
|
$rel_parts = parse_url($rel_url);
|
||||||
|
|
||||||
if ($rel_parts['host'] && $rel_parts['scheme']) {
|
if ($rel_parts['host'] && $rel_parts['scheme']) {
|
||||||
return $rel_url;
|
return validate_url($rel_url);
|
||||||
} else if (strpos($rel_url, "//") === 0) {
|
} else if (strpos($rel_url, "//") === 0) {
|
||||||
# protocol-relative URL (rare but they exist)
|
# protocol-relative URL (rare but they exist)
|
||||||
return "https:" . $rel_url;
|
return validate_url("https:" . $rel_url);
|
||||||
} else if (strpos($rel_url, "magnet:") === 0) {
|
} else if (strpos($rel_url, "magnet:") === 0) {
|
||||||
# allow magnet links
|
# allow magnet links
|
||||||
return $rel_url;
|
return $rel_url;
|
||||||
@@ -1552,7 +1552,7 @@
|
|||||||
$parts['path'] = str_replace("/./", "/", $parts['path']);
|
$parts['path'] = str_replace("/./", "/", $parts['path']);
|
||||||
$parts['path'] = str_replace("//", "/", $parts['path']);
|
$parts['path'] = str_replace("//", "/", $parts['path']);
|
||||||
|
|
||||||
return build_url($parts);
|
return validate_url(build_url($parts));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user