[BUGFIX] Prevent OutOfBoundsException in filelist 09/47809/2
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 13:03:07 +0000 (15:03 +0200)
Change-Id: I1138487a2bae071d2393a38389ef918b5087d9ea
Resolves: #75370
Releases: master, 7.6
Reviewed-on: https://review.typo3.org/47809
Reviewed-by: Philipp Gampe <philipp.gampe@typo3.org>
Tested-by: Philipp Gampe <philipp.gampe@typo3.org>
typo3/sysext/filelist/Classes/FileList.php

index 34b5781..546a498 100644 (file)
@@ -381,6 +381,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;
@@ -418,9 +419,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;