rewrite_relative: deal with undefined path warning

This commit is contained in:
Andrew Dolgov 2022-03-22 19:43:32 +03:00
parent 0345e9d3f6
commit 385da287d8
1 changed files with 2 additions and 2 deletions

View File

@ -110,10 +110,10 @@ class UrlHelper {
$rel_parts['host'] = $base_parts['host'] ?? "";
$rel_parts['scheme'] = $base_parts['scheme'] ?? "";
if (isset($rel_parts['path'])) {
if ($rel_parts['path'] ?? "") {
// we append dirname() of base path to relative URL path as per RFC 3986 section 5.2.2
$base_path = with_trailing_slash(dirname($base_parts['path']));
$base_path = with_trailing_slash(dirname($base_parts['path'] ?? ""));
// 1. absolute relative path (/test.html) = no-op, proceed as is