Skip to content

Commit 85bd179

Browse files
asmecherGaziYucel
authored andcommitted
#10632 Fix array use before initialization
1 parent 0490107 commit 85bd179

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

classes/core/VirtualArrayIterator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@ public function __construct(array $theArray, int $totalItems, int $page = -1, in
4949
parent::__construct();
5050
if ($page >= 1 && $itemsPerPage >= 1) {
5151
$this->page = $page;
52+
$this->itemsPerPage = $itemsPerPage;
5253
} else {
5354
$this->page = 1;
54-
$this->itemsPerPage = max(count($this->theArray), 1);
55+
$this->itemsPerPage = max(count($theArray), 1);
5556
}
5657
$this->theArray = $theArray;
5758
$this->count = $totalItems;
58-
$this->itemsPerPage = $itemsPerPage;
5959
$this->wasEmpty = count($this->theArray) == 0;
6060
reset($this->theArray);
6161
}

0 commit comments

Comments
 (0)