[BUGFIX] Make files deletable if storage is not browsable 53/61153/3
authorMarkus Klein <markus.klein@typo3.org>
Wed, 26 Jun 2019 12:02:23 +0000 (14:02 +0200)
committerBenjamin Franzke <bfr@qbus.de>
Sun, 21 Jul 2019 19:38:09 +0000 (21:38 +0200)
A check is added to abort the search for a recycler folder
if a storage is not browsable.
An editor wouldn't be able to recover the file anyways as
this requires browsing the storage.

Resolves: #88632
Releases: master, 9.5, 8.7
Change-Id: Ie59b53c8b17434bb162de7c52a756d7ea3ceb88d
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/61153
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Johannes Kasberger <johannes.kasberger@reelworx.at>
Tested-by: Benjamin Franzke <bfr@qbus.de>
Reviewed-by: Johannes Kasberger <johannes.kasberger@reelworx.at>
Reviewed-by: Benni Mack <benni@typo3.org>
Reviewed-by: Frans Saris <franssaris@gmail.com>
Reviewed-by: Daniel Goerz <daniel.goerz@posteo.de>
Reviewed-by: Julian Geils <j_geils@web.de>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Benjamin Franzke <bfr@qbus.de>
typo3/sysext/core/Classes/Resource/ResourceStorage.php

index 77dfa49..7fa20d7 100644 (file)
@@ -3159,6 +3159,10 @@ class ResourceStorage implements ResourceStorageInterface
         if ($file instanceof ProcessedFile) {
             return null;
         }
+        // if the storage is not browsable we cannot fetch the parent folder of the file so no recycler handling is possible
+        if (!$this->isBrowsable()) {
+            return null;
+        }
 
         $recyclerFolder = null;
         $folder = $file->getParentFolder();