[BUGFIX] Extension upload as zip on Windows systems ignores directories 11/26911/2
authorWouter Wolters <typo3@wouterwolters.nl>
Fri, 17 Jan 2014 20:13:58 +0000 (21:13 +0100)
committerNicole Cordes <typo3@cordes.co>
Fri, 7 Mar 2014 21:03:50 +0000 (22:03 +0100)
Using DIRECTORY_SEPARATOR on Windows environments is a "\" instead of
a "/". Fix this by replacing the constant with '/'.

Resolves: #53740
Resolves: #53346
Releases: 6.2
Change-Id: Ia745a17fd47c527b57e78babef76b67f30af0454
Reviewed-on: https://review.typo3.org/26911
Reviewed-by: Jigal van Hemert
Tested-by: Jigal van Hemert
Reviewed-by: Nicole Cordes
Tested-by: Nicole Cordes
typo3/sysext/extensionmanager/Classes/Utility/FileHandlingUtility.php

index 38ff77d..1a70bed 100644 (file)
@@ -390,10 +390,10 @@ class FileHandlingUtility implements \TYPO3\CMS\Core\SingletonInterface {
                $zip = zip_open($file);
                if (is_resource($zip)) {
                        while (($zipEntry = zip_read($zip)) !== FALSE) {
-                               if (strpos(zip_entry_name($zipEntry), DIRECTORY_SEPARATOR) !== FALSE) {
-                                       $last = strrpos(zip_entry_name($zipEntry), DIRECTORY_SEPARATOR);
+                               if (strpos(zip_entry_name($zipEntry), '/') !== FALSE) {
+                                       $last = strrpos(zip_entry_name($zipEntry), '/');
                                        $dir = substr(zip_entry_name($zipEntry), 0, $last);
-                                       $file = substr(zip_entry_name($zipEntry), strrpos(zip_entry_name($zipEntry), DIRECTORY_SEPARATOR) + 1);
+                                       $file = substr(zip_entry_name($zipEntry), strrpos(zip_entry_name($zipEntry), '/') + 1);
                                        if (!is_dir($dir)) {
                                                GeneralUtility::mkdir_deep($extensionDir . $dir);
                                        }