From c92bfa822fc0cd282b7a26bfac5be319ce605364 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Tue, 6 Apr 2021 09:19:30 +0200 Subject: [PATCH] fix PHP 8 Fatal error caused by not parsable URL like "://@/path" (missing domain) --- api/src/Vfs.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/api/src/Vfs.php b/api/src/Vfs.php index f866913215..7db81a9198 100644 --- a/api/src/Vfs.php +++ b/api/src/Vfs.php @@ -1205,6 +1205,13 @@ class Vfs extends Vfs\Base // Parse the encoded URL $result = $encodedParts = parse_url($encodedURL); + // check if parsing failed because of an url like "://@/path" (no host) --> add "default" + // that kind of url can get constructed in VFS when adding user-context (host has no meaning in Vfs) + if ($result === false && strpos($encodedURL, '@/') !== false) + { + $result = $encodedParts = parse_url(str_replace('@/', '@default/', $encodedURL)); + } + // Now, decode each value of the resulting array if ($encodedParts) {