fix disposition filename extension

This commit is contained in:
2023-03-13 22:10:15 +10:00
parent 630418cf02
commit 5f960cca71

View File

@@ -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);
}
}