[BUGFIX] Correctly resolve parent folder in AbstractHierarchicalFilesystemDriver 07/57207/4
authorNicole Cordes <typo3@cordes.co>
Wed, 13 Jun 2018 10:08:15 +0000 (12:08 +0200)
committerBenni Mack <benni@typo3.org>
Sun, 28 Oct 2018 12:21:15 +0000 (13:21 +0100)
This patch ensures that
AbstractHierarchicalFilesystemDriver::getParentFolderIdentifierOfIdentifier
always returns a file identifier using forward slashes. Furthermore
it removes double forward slashes for a root folder identifier.

Resolves: #85249
Releases: master, 8.7
Change-Id: I562eaade7353e5235d4f65725a4159f6c0b71d75
Reviewed-on: https://review.typo3.org/57207
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Susanne Moog <susanne.moog@typo3.org>
Reviewed-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: Susanne Moog <susanne.moog@typo3.org>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
typo3/sysext/core/Classes/Resource/Driver/AbstractHierarchicalFilesystemDriver.php

index 3284dec..e15710a 100644 (file)
@@ -120,6 +120,6 @@ abstract class AbstractHierarchicalFilesystemDriver extends AbstractDriver
     public function getParentFolderIdentifierOfIdentifier($fileIdentifier)
     {
         $fileIdentifier = $this->canonicalizeAndCheckFileIdentifier($fileIdentifier);
-        return PathUtility::dirname($fileIdentifier) . '/';
+        return rtrim(GeneralUtility::fixWindowsFilePath(PathUtility::dirname($fileIdentifier)), '/') . '/';
     }
 }