[BUGFIX] Automatic creation of processed files folder fails 38/19638/2
authorAndreas Wolf <andreas.wolf@typo3.org>
Fri, 22 Mar 2013 21:54:24 +0000 (22:54 +0100)
committerSteffen Ritter <info@rs-websystems.de>
Fri, 5 Apr 2013 23:08:04 +0000 (01:08 +0200)
The ResourceStorage tries to automatically create the processed files
folder if it does not exist. The identifier of the folder is taken from
the storage's configuration.

The automatic creation however fails, because when splitting the
identifier (e.g. /someFolder/_processed_/) by '/', the resulting array
always contains empty elements. Creating a folder with an empty name
fails however; therefore, empty elements should be skipped.

Change-Id: Ia9d0fe5314f67cb01da20682dfb684b711bc3cf7
Resolves: #46586
Releases: 6.1, 6.0
Reviewed-on: https://review.typo3.org/19638
Reviewed-by: Steffen Ritter
Tested-by: Steffen Ritter
typo3/sysext/core/Classes/Resource/ResourceStorage.php

index 7f2f931..e6881f7 100644 (file)
@@ -2006,6 +2006,9 @@ class ResourceStorage {
                                $processingFolderParts = explode('/', $processingFolder);
                                $parentFolder = $this->driver->getRootLevelFolder();
                                foreach ($processingFolderParts as $folderPart) {
+                                       if ($folderPart === '') {
+                                               continue;
+                                       }
                                        if (!$this->driver->folderExistsInFolder($folderPart, $parentFolder)) {
                                                $parentFolder = $this->driver->createFolder($folderPart, $parentFolder);
                                        } else {