[BUGFIX] fix windows file paths in copydirectory 79/47879/2
authorJigal van Hemert <jigal.van.hemert@typo3.org>
Sat, 23 Apr 2016 18:39:01 +0000 (20:39 +0200)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Mon, 18 Feb 2019 21:03:37 +0000 (22:03 +0100)
Make sure forward slashes are used in paths. Also, use a string
to pass to upload_copy_move instead of an SplFileInfo object.

Resolves: #75887
Releases: master
Change-Id: Ida634e954b19bd1dee5ab5aca25affab51e8ed06
Reviewed-on: https://review.typo3.org/c/47879
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Benni Mack <benni@typo3.org>
Tested-by: Susanne Moog <susanne.moog@typo3.org>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Jörg Bösche <typo3@joergboesche.de>
Reviewed-by: Elmar Hinz <t3elmar@gmail.com>
Reviewed-by: Sascha Rademacher <sascha.rademacher+typo3@gmail.com>
Reviewed-by: Sonja Großewinkelmann <s.grossewinkelmann@neusta.de>
Reviewed-by: Tobi Kretschmann <tobi@tobishome.de>
Reviewed-by: Steffen Frese <steffenf14@gmail.com>
Reviewed-by: Alessandro Filira <alessandro.filira@pallino.it>
Reviewed-by: Benni Mack <benni@typo3.org>
Reviewed-by: Susanne Moog <susanne.moog@typo3.org>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
typo3/sysext/core/Classes/Utility/GeneralUtility.php

index 1a98db4..b616ebc 100644 (file)
@@ -3101,12 +3101,13 @@ class GeneralUtility
                 new \RecursiveDirectoryIterator($source, \RecursiveDirectoryIterator::SKIP_DOTS),
                 \RecursiveIteratorIterator::SELF_FIRST
             );
+            /** @var \SplFileInfo $item */
             foreach ($iterator as $item) {
-                $target = $destination . '/' . $iterator->getSubPathName();
+                $target = $destination . '/' . static::fixWindowsFilePath($iterator->getSubPathName());
                 if ($item->isDir()) {
                     static::mkdir($target);
                 } else {
-                    static::upload_copy_move($item, $target);
+                    static::upload_copy_move(static::fixWindowsFilePath($item->getPathname()), $target);
                 }
             }
         }