From 385da287d8640e1ac9d2ade95b7deacb4f0bcf8f Mon Sep 17 00:00:00 2001
From: Andrew Dolgov <noreply@fakecake.org>
Date: Tue, 22 Mar 2022 19:43:32 +0300
Subject: [PATCH] rewrite_relative: deal with undefined path warning

---
 classes/urlhelper.php | 4 ++--
 1 file 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
 
-- 
GitLab