In case the current image is not included return the correct amount of items.
authorBryan Tong Minh <btongminh@users.mediawiki.org>
Sat, 2 Feb 2008 21:14:45 +0000 (21:14 +0000)
committerBryan Tong Minh <btongminh@users.mediawiki.org>
Sat, 2 Feb 2008 21:14:45 +0000 (21:14 +0000)
includes/api/ApiQueryImageInfo.php

index 53239b2..5a2a32d 100644 (file)
@@ -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);