diff --git a/app.php b/app.php index 9f99446..32a475d 100644 --- a/app.php +++ b/app.php @@ -429,9 +429,7 @@ function($f3) { } else { $compressionType = '/screen'; } - - $arrayPath = array_keys($files); - $filePath = reset($arrayPath); + $filePath = reset(array_keys($files)); $outputFileName = str_replace(".pdf", "_compressed.pdf", $filePath); @@ -444,7 +442,7 @@ function($f3) { header('location: /compress?err=' . $error); } else { header('Content-Type: application/pdf'); - header("Content-Disposition: attachment; filename=$outputFileName"); + header("Content-Disposition: attachment; filename=".basename($outputFileName)); readfile($outputFileName); } @@ -488,8 +486,6 @@ function($f3) { }); - - function getCommit() { if(!file_exists(__DIR__.'/.git/HEAD')) {