[BUGFIX] Fix path in FAL exception message 51/49851/2
authorSascha Egerer <sascha@sascha-egerer.de>
Sat, 3 Sep 2016 17:46:31 +0000 (19:46 +0200)
committerAndreas Fernandez <typo3@scripting-base.de>
Sun, 4 Sep 2016 08:49:50 +0000 (10:49 +0200)
When copying of a resource fails the exception message contains
a wrong path to the file because the filename is added to the path
without a slash.

Resolves: #77836
Releases: master
Change-Id: Ibebef4cad46ba81a37d8860d1a8fdf030604a363
Reviewed-on: https://review.typo3.org/49851
Tested-by: Bamboo TYPO3com <info@typo3.com>
Reviewed-by: Kay Strobach <typo3@kay-strobach.de>
Tested-by: Kay Strobach <typo3@kay-strobach.de>
Reviewed-by: Joerg Boesche <typo3@joergboesche.de>
Tested-by: Joerg Boesche <typo3@joergboesche.de>
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez <typo3@scripting-base.de>
typo3/sysext/core/Classes/Resource/Driver/LocalDriver.php

index 81d3a2e..e564b59 100644 (file)
@@ -1057,12 +1057,14 @@ class LocalDriver extends AbstractHierarchicalFilesystemDriver
             if ($current->isDir() && !($fileName === '..' || $fileName === '.')) {
                 GeneralUtility::mkdir($targetFolderPath . '/' . $itemSubPath);
             } elseif ($current->isFile()) {
-                $result = copy($sourceFolderPath . '/' . $itemSubPath, $targetFolderPath . '/' . $itemSubPath);
+                $copySourcePath = $sourceFolderPath . '/' . $itemSubPath;
+                $copyTargetPath = $targetFolderPath . '/' . $itemSubPath;
+                $result = copy($copySourcePath, $copyTargetPath);
                 if ($result === false) {
                     // rollback
                     GeneralUtility::rmdir($targetFolderIdentifier, true);
                     throw new Exception\FileOperationErrorException(
-                        'Copying file "' . $sourceFolderPath . $itemSubPath . '" to "' . $targetFolderPath . $itemSubPath . '" failed.',
+                        'Copying resource "' . $copySourcePath . '" to "' . $copyTargetPath . '" failed.',
                         1330119452
                     );
                 }