[BUGFIX] Correctly resolve parent folder in AbstractHierarchicalFilesystemDriver 57/58757/2
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:34:13 +0000 (13:34 +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/58757
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
typo3/sysext/core/Classes/Resource/Driver/AbstractHierarchicalFilesystemDriver.php

index 28fb94c..98a96cd 100644 (file)
@@ -117,6 +117,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)), '/') . '/';
     }
 }