[BUGFIX] Off-by-one error in FAL's LocalDriver 61/46461/3
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:06 +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/46461
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Reviewed-by: Mathias Schreiber <mathias.schreiber@wmdb.de>
Tested-by: Mathias Schreiber <mathias.schreiber@wmdb.de>
Reviewed-by: Roman Schürmann <roman.schuermann@wmdb.de>
Reviewed-by: Frans Saris <franssaris@gmail.com>
Reviewed-by: Daniel Goerz <ervaude@gmail.com>
Tested-by: Daniel Goerz <ervaude@gmail.com>
Reviewed-by: Michael Oehlhof <typo3@oehlhof.de>
Tested-by: Michael Oehlhof <typo3@oehlhof.de>
Reviewed-by: Markus Sommer <markussom@posteo.de>
Tested-by: Markus Sommer <markussom@posteo.de>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez <typo3@scripting-base.de>

index 31bf3a0..d354158 100644 (file)
@@ -368,10 +368,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) {