diff --git a/src/Service/OfficeIndexService.php b/src/Service/OfficeIndexService.php index 8071950..f5f580f 100644 --- a/src/Service/OfficeIndexService.php +++ b/src/Service/OfficeIndexService.php @@ -107,7 +107,14 @@ class OfficeIndexService parse_str($parts['query'], $query); if (!empty($query['p'])) { - $p = rawurldecode((string) $query['p']); + $p = (string) $query['p']; + + // Query-Parameter korrekt dekodieren + $p = urldecode($p); + + // Leerzeichen aus Query-Parametern wieder zu '+' normalisieren + $p = str_replace(' ', '+', $p); + $ext = strtolower(pathinfo($p, PATHINFO_EXTENSION)); if (in_array($ext, ['docx', 'xlsx', 'pptx'], true)) { diff --git a/src/Service/PdfIndexService.php b/src/Service/PdfIndexService.php index 3df6f66..9d37e12 100644 --- a/src/Service/PdfIndexService.php +++ b/src/Service/PdfIndexService.php @@ -132,7 +132,12 @@ class PdfIndexService if (!empty($query['p'])) { $p = (string) $query['p']; - $p = rawurldecode($p); + + // Query-Parameter korrekt dekodieren + $p = urldecode($p); + + // Leerzeichen aus Query-Parametern wieder zu '+' normalisieren + $p = str_replace(' ', '+', $p); // deine Links enthalten oft "pdf/DATEI.pdf" // => wird zu "/files/pdf/DATEI.pdf"