[BUGFIX] Prevent OutOfBoundsException in filelist 06/47806/4
authorFrans Saris <franssaris@gmail.com>
Wed, 20 Apr 2016 12:00:05 +0000 (14:00 +0200)
committerPhilipp Gampe <philipp.gampe@typo3.org>
Wed, 20 Apr 2016 12:47:12 +0000 (14:47 +0200)
Change-Id: I1138487a2bae071d2393a38389ef918b5087d9ea
Resolves: #75370
Releases: master, 7.6
Reviewed-on: https://review.typo3.org/47806
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Christoph Kratz <ckr@rtp.ch>
Tested-by: Christoph Kratz <ckr@rtp.ch>
Reviewed-by: Philipp Gampe <philipp.gampe@typo3.org>
Tested-by: Philipp Gampe <philipp.gampe@typo3.org>
typo3/sysext/filelist/Classes/FileList.php

index 9ab1c1f..375c66a 100644 (file)
@@ -327,6 +327,7 @@ class FileList extends AbstractRecordList
                     }
                 }
             }
+
             $folders = $storage->getFoldersInFolder($this->folderObject, $foldersFrom, $foldersNum, true, false, trim($this->sort), (bool)$this->sortRev);
             $files = $this->folderObject->getFiles($filesFrom, $filesNum, Folder::FILTER_MODE_USE_OWN_AND_STORAGE_FILTERS, false, trim($this->sort), (bool)$this->sortRev);
             $this->totalItems = $foldersCount + $filesCount;
@@ -364,9 +365,9 @@ class FileList extends AbstractRecordList
             // Files are added
             $iOut .= $this->formatFileList($files);
 
-            $this->eCounter = $this->firstElementNumber + $this->iLimit <= $this->totalItems
+            $this->eCounter = $this->firstElementNumber + $this->iLimit < $this->totalItems
                 ? $this->firstElementNumber + $this->iLimit
-                : $this->totalItems;
+                : -1;
             list(, $code) = $this->fwd_rwd_nav();
             $iOut .= $code;