From 5e60b402e97665a17492a8b1f71fd829c458097d Mon Sep 17 00:00:00 2001 From: Jan-Hendrik Willms Date: Fri, 14 Nov 2025 17:00:00 +0100 Subject: also respond to http status 308 and build redirect url correctly, fixes #6052 --- lib/filesystem/FileManager.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/filesystem/FileManager.php b/lib/filesystem/FileManager.php index 80889c1..45574db 100644 --- a/lib/filesystem/FileManager.php +++ b/lib/filesystem/FileManager.php @@ -1650,9 +1650,12 @@ class FileManager // Weg über einen Locationheader: $location_header = $header['Location'] ?? $header['location'] ?? null; - if (in_array($header['response_code'], [300, 301, 302, 303, 305, 307]) && $location_header) { - if (mb_strpos($location_header, 'http') !== 0) { - $location_header = $url_parts['scheme'] . '://' . $url_parts['host'] . '/' . $location_header; + if ( + in_array($header['response_code'], [300, 301, 302, 303, 305, 307, 308]) + && $location_header + ) { + if (!str_starts_with($location_header, 'http')) { + $location_header = $url_parts['scheme'] . '://' . $url_parts['host'] . $location_header; } $header = self::fetchURLMetadata($location_header, $level + 1); } -- cgit v1.0