diff --git a/src/structure/components/com_sportsmanager/admin.php b/src/structure/components/com_sportsmanager/admin.php index c1bfe25..420c598 100644 --- a/src/structure/components/com_sportsmanager/admin.php +++ b/src/structure/components/com_sportsmanager/admin.php @@ -17622,10 +17622,18 @@ function terminDokument() { } $extension = strtolower(JFile::getExt($dokumente[0])); - if ($extension == "pdf") - $mm_type = "application/pdf"; - else - $mm_type = "application/octet-stream"; + $mimeTypes = [ + 'jpg' => 'image/jpeg', + 'jpeg' => 'image/jpeg', + 'png' => 'image/png', + 'webp' => 'image/webp', + 'pdf' => 'application/pdf', + 'txt' => 'text/plain' + // Add more as needed + ]; + + // Return the corresponding MIME type or a default + $mm_type = $mimeTypes[$extension] ?? 'application/octet-stream'; ob_end_clean(); // Wegen UTF-8-Zeichen, die in der ausgabe vorhanden sind header("Pragma: public");