From eb0caaec62f116e3a373a06ba0acd92a97a836cc Mon Sep 17 00:00:00 2001 From: Bryan Tong Minh Date: Sat, 2 Feb 2008 21:14:45 +0000 Subject: [PATCH] In case the current image is not included return the correct amount of items. --- includes/api/ApiQueryImageInfo.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/api/ApiQueryImageInfo.php b/includes/api/ApiQueryImageInfo.php index 53239b2b10..5a2a32d04e 100644 --- a/includes/api/ApiQueryImageInfo.php +++ b/includes/api/ApiQueryImageInfo.php @@ -79,8 +79,8 @@ class ApiQueryImageInfo extends ApiQueryBase { } // Now get the old revisions - if($params['limit'] > 1) { - $oldies = $img->getHistory($params['limit'] - 1, $params['start'], $params['end']); + if($params['limit'] > count($data)) { + $oldies = $img->getHistory($params['limit'] - count($data), $params['start'], $params['end']); if(!empty($oldies)) foreach($oldies as $oldie) $data[] = $this->getInfo($oldie); -- 2.20.1