From ede5b8f0b90388da2c8e20de31ca8f46ed15292f Mon Sep 17 00:00:00 2001 From: Alexander Klimov Date: Wed, 3 Sep 2014 18:36:59 +0200 Subject: [PATCH] Icinga\Protocol\File\Reader::fetchPairs(): increase $index manually as the iterator's one makes trouble refs #7060 --- library/Icinga/Protocol/File/Reader.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/library/Icinga/Protocol/File/Reader.php b/library/Icinga/Protocol/File/Reader.php index 1ab088c9c..0f5509b7b 100644 --- a/library/Icinga/Protocol/File/Reader.php +++ b/library/Icinga/Protocol/File/Reader.php @@ -154,13 +154,15 @@ class Reader extends FilterIterator $skip = $count - ($skip + $read); } } - foreach ($this as $index => $line) { + $index = 0; + foreach ($this as $line) { if ($index >= $skip) { if ($index >= $skip + $read) { break; } $lines[] = $line; } + ++$index; } if ($query->sortDesc()) { $lines = array_reverse($lines);