[BUGFIX] Prevent double slash in isWithin check
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Classes / Resource / Driver / LocalDriver.php
index 03340cc..7825b62 100644 (file)
@@ -1084,7 +1084,12 @@ class LocalDriver extends AbstractHierarchicalFilesystemDriver {
                if ($folderIdentifier === $entryIdentifier) {
                        return TRUE;
                }
-               return GeneralUtility::isFirstPartOfStr($entryIdentifier, $folderIdentifier . '/');
+               // File identifier canonicalization will not modify a single slash so
+               // we must not append another slash in that case.
+               if ($folderIdentifier !== '/') {
+                       $folderIdentifier .= '/';
+               }
+               return GeneralUtility::isFirstPartOfStr($entryIdentifier, $folderIdentifier);
        }
 
        /**