From a95cd777c77b3e0c7f18a6f10c95dbfa5dc3de57 Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Thu, 7 Feb 2008 12:21:48 +0000 Subject: [PATCH] (bug 12953) prop=imageinfo should only set query-continue when there is only one title; trying to overwrite a previously set query-continue causes a fatal error --- includes/api/ApiQueryImageInfo.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/includes/api/ApiQueryImageInfo.php b/includes/api/ApiQueryImageInfo.php index 0e214db3f8..fb11c12d35 100644 --- a/includes/api/ApiQueryImageInfo.php +++ b/includes/api/ApiQueryImageInfo.php @@ -81,11 +81,13 @@ class ApiQueryImageInfo extends ApiQueryBase { // Now get the old revisions // Get one more to facilitate query-continue functionality $count = count($data); - $oldies = $img->getHistory($params['limit'] - count($data) + 1, $params['start'], $params['end']); + $oldies = $img->getHistory($params['limit'] - $count + 1, $params['start'], $params['end']); foreach($oldies as $oldie) { if(++$count > $params['limit']) { // We've reached the extra one which shows that there are additional pages to be had. Stop here... - $this->setContinueEnumParameter('start', $oldie->getTimestamp()); + // Only set a query-continue if there was only one title + if(count($pageIds[NS_IMAGE]) == 1) + $this->setContinueEnumParameter('start', $oldie->getTimestamp()); break; } $data[] = $this->getInfo($oldie); -- 2.20.1