[BUGFIX] Remove double zip extension when downloading in EM 34/57834/2
authorWouter Wolters <typo3@wouterwolters.nl>
Wed, 8 Aug 2018 11:48:33 +0000 (13:48 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Thu, 9 Aug 2018 11:59:49 +0000 (13:59 +0200)
The download as zip action outputs the zip file with double .zip
extension. Remove the second .zip from the header.

Resolves: #85770
Releases: master,8.7
Change-Id: Iecc69676cd019060f2bd9e86f97d6adc0e9b6c2b
Reviewed-on: https://review.typo3.org/57834
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/extensionmanager/Classes/Utility/FileHandlingUtility.php

index 7e6650a..e02e806 100644 (file)
@@ -506,11 +506,11 @@ class FileHandlingUtility implements \TYPO3\CMS\Core\SingletonInterface
     public function sendZipFileToBrowserAndDelete($fileName, $downloadName = '')
     {
         if ($downloadName === '') {
-            $downloadName = PathUtility::basename($fileName, '.zip');
+            $downloadName = PathUtility::basename($fileName);
         }
         header('Content-Type: application/zip');
         header('Content-Length: ' . filesize($fileName));
-        header('Content-Disposition: attachment; filename="' . $downloadName . '.zip"');
+        header('Content-Disposition: attachment; filename="' . $downloadName . '"');
         readfile($fileName);
         unlink($fileName);
         die;