diff options
| author | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2025-11-14 17:00:00 +0100 |
|---|---|---|
| committer | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2025-11-14 17:00:00 +0100 |
| commit | 5e60b402e97665a17492a8b1f71fd829c458097d (patch) | |
| tree | 122f8f664045d570557386c912a24b284d9850eb /lib/filesystem | |
| parent | a1026373531f77890799ca5f306802544afb9510 (diff) | |
also respond to http status 308 and build redirect url correctly, fixes #6052biest-6052
Diffstat (limited to 'lib/filesystem')
| -rw-r--r-- | lib/filesystem/FileManager.php | 9 |
1 files 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); } |
