diff options
author | Andrew Dolgov <[email protected]> | 2022-03-22 19:43:32 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2022-03-22 19:43:32 +0300 |
commit | 385da287d8640e1ac9d2ade95b7deacb4f0bcf8f (patch) | |
tree | e5955d102834f5545fa6bbdc8d56f847d21243b5 /classes/urlhelper.php | |
parent | 0345e9d3f61e4f2e761cbcf68d5edb2bec1c163f (diff) |
rewrite_relative: deal with undefined path warning
Diffstat (limited to 'classes/urlhelper.php')
-rw-r--r-- | classes/urlhelper.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/classes/urlhelper.php b/classes/urlhelper.php index 8cd69abe4..83f66a810 100644 --- a/classes/urlhelper.php +++ b/classes/urlhelper.php @@ -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 |