[BUGFIX] Off-by-one error in FAL's LocalDriver 01/46501/2
authorAndreas Fernandez <a.fernandez@scripting-base.de>
Wed, 3 Feb 2016 14:33:44 +0000 (15:33 +0100)
committerAndreas Fernandez <typo3@scripting-base.de>
Fri, 5 Feb 2016 15:52:29 +0000 (16:52 +0100)
Currently, the LocalDriver of FAL has an off-by-one issue. The passed
starting pointer gets decremented by one, causing issues in the file list
while browsing.

The pointer decrement is removed with this change.

The whole core does not call ``ResourceStorage->getFilesInFolder()``
with the parameters``$start`` and ``$maxNumberOfItems`` having
another value than 0, so this change is assumed to be safe.

Change-Id: I4e24f18b3222f2abdbed83fbbcb18c73d6e52316
Resolves: #73103
Releases: master, 7.6, 6.2
Reviewed-on: https://review.typo3.org/46501
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez <typo3@scripting-base.de>
typo3/sysext/core/Classes/Resource/Driver/LocalDriver.php

index d628ad8..81ed0d5 100644 (file)
@@ -370,10 +370,6 @@ class LocalDriver extends AbstractHierarchicalFilesystemDriver
             );
         }
 
-        if ($start > 0) {
-            $start--;
-        }
-
         $items = $this->retrieveFileAndFoldersInPath($realPath, $recursive, $includeFiles, $includeDirs, $sort, $sortRev);
         $iterator = new \ArrayIterator($items);
         if ($iterator->count() === 0) {