From 5f960cca71fe9f93f8528544fdab773d98eec1e9 Mon Sep 17 00:00:00 2001 From: James Collins Date: Mon, 13 Mar 2023 22:10:15 +1000 Subject: [PATCH] fix disposition filename extension --- public/media.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/media.php b/public/media.php index 6e23e2f..c27bb45 100644 --- a/public/media.php +++ b/public/media.php @@ -26,7 +26,7 @@ if ($filepath !== false && strlen($filepath) > 0 && strpos($_GET['url'], 'upload // Output the original image to the browser header('Content-Type: '. mime_content_type($filepath)); - header('Content-Disposition: inline; filename=' . pathinfo($filepath, PATHINFO_FILENAME) . pathinfo($filepath, PATHINFO_EXTENSION)); + header('Content-Disposition: inline; filename=' . pathinfo($filepath, PATHINFO_FILENAME) . '.' . pathinfo($filepath, PATHINFO_EXTENSION)); readfile($filepath); } else { $newWidth = (isset($_GET['w']) ? intval($_GET['w']) : -1); @@ -72,7 +72,7 @@ if ($filepath !== false && strlen($filepath) > 0 && strpos($_GET['url'], 'upload } else { // Output the original image to the browser header('Content-Type: '. mime_content_type($filepath)); - header('Content-Disposition: inline; filename=' . pathinfo($filepath, PATHINFO_FILENAME) . pathinfo($filepath, PATHINFO_EXTENSION)); + header('Content-Disposition: inline; filename=' . pathinfo($filepath, PATHINFO_FILENAME) . '.' . pathinfo($filepath, PATHINFO_EXTENSION)); readfile($filepath); } }