[BUGFIX] Do not add trailing slashes to files 98/23698/2
authorHelmut Hummel <helmut.hummel@typo3.org>
Mon, 9 Sep 2013 15:13:09 +0000 (17:13 +0200)
committerHelmut Hummel <helmut.hummel@typo3.org>
Mon, 9 Sep 2013 16:26:18 +0000 (18:26 +0200)
In the security fix #50883 a canonicalize method
for folders has been used where items could
either be files or folders.

This added a trailing slash to files which triggered
a basedir PHP warning if basedir is configured
in PHP.

Use the canonicalize method for file paths instead
to fix this issue.

Resolves: #51761
Releases: 6.0, 6.1, 6.2
Change-Id: I9ef4b6a90ca257ad0104115bd7d48c4de68f135f
Reviewed-on: https://review.typo3.org/23698
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel
typo3/sysext/core/Classes/Resource/Driver/LocalDriver.php

index 4f04ded..3cccafd 100644 (file)
@@ -394,7 +394,7 @@ class LocalDriver extends AbstractHierarchicalFilesystemDriver {
         * @return array
         */
        protected function getFolderList_itemCallback($folderName, $parentPath, array $folderRow = array()) {
-               $folderPath = $this->getAbsolutePath($this->canonicalizeAndCheckFolderPath($parentPath . $folderName));
+               $folderPath = $this->getAbsolutePath($this->canonicalizeAndCheckFilePath($parentPath . $folderName));
 
                if (!is_dir($folderPath)) {
                        return array('', array());