From: Bryan Tong Minh Date: Sat, 2 Feb 2008 21:14:45 +0000 (+0000) Subject: In case the current image is not included return the correct amount of items. X-Git-Tag: 1.31.0-rc.0~49650 X-Git-Url: http://git.cyclocoop.org/?a=commitdiff_plain;h=eb0caaec62f116e3a373a06ba0acd92a97a836cc;p=lhc%2Fweb%2Fwiklou.git In case the current image is not included return the correct amount of items. --- 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);