[BUGFIX] Allow deletion of File Recycler in fileadmin 13/49113/2
authorSteven Cardoso <steven.cardoso@dkd.de>
Tue, 19 Jul 2016 13:31:59 +0000 (15:31 +0200)
committerBenni Mack <benni@typo3.org>
Tue, 19 Jul 2016 19:53:25 +0000 (21:53 +0200)
This patch deletes a file recycler instead of trying to move it into
itself by renaming. The patch respects the user settings for recursive
deletion.

Resolves: #77091
Releases: master, 7.6
Change-Id: Iaf045f322c8fac661e1d0fa9bed2ae6e7a6ccc18
Reviewed-on: https://review.typo3.org/49113
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
typo3/sysext/core/Classes/Resource/Driver/LocalDriver.php

index 845c17f..50b70cb 100644 (file)
@@ -1190,7 +1190,7 @@ class LocalDriver extends AbstractHierarchicalFilesystemDriver
     {
         $folderPath = $this->getAbsolutePath($folderIdentifier);
         $recycleDirectory = $this->getRecycleDirectory($folderPath);
-        if (!empty($recycleDirectory)) {
+        if (!empty($recycleDirectory) && $folderPath !== $recycleDirectory) {
             $result = $this->recycleFileOrFolder($folderPath, $recycleDirectory);
         } else {
             $result = GeneralUtility::rmdir($folderPath, $deleteRecursively);