From 326850845da67fcdd3bf736a470bad6233234ec8 Mon Sep 17 00:00:00 2001
From: Andrew Dolgov <noreply@fakecake.org>
Date: Fri, 21 May 2021 17:10:32 +0300
Subject: [PATCH] UrlHelper::rewrite_relative: don't try to feed NULL to
 with_trailing_slash()

---
 classes/urlhelper.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/classes/urlhelper.php b/classes/urlhelper.php
index 136046701..03f0c474d 100644
--- a/classes/urlhelper.php
+++ b/classes/urlhelper.php
@@ -51,7 +51,7 @@ class UrlHelper {
 				// (i'm not sure if it's a good idea)
 
 				if (strpos($rel_parts['path'], '/') !== 0) {
-					$rel_parts['path'] = with_trailing_slash($base_parts['path']) . $rel_parts['path'];
+					$rel_parts['path'] = with_trailing_slash($base_parts['path'] ?? "") . $rel_parts['path'];
 				}
 
 				$rel_parts['path'] = str_replace("/./", "/", $rel_parts['path']);
-- 
GitLab