From: Yuri Astrakhan Date: Sat, 19 May 2007 01:46:13 +0000 (+0000) Subject: API: fixed bug 9938: Querying by revids on api.php returns the most recent revision... X-Git-Tag: 1.31.0-rc.0~52874 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/?a=commitdiff_plain;h=77cc38c788beaea9d962690c576b302d07cbb48e;p=lhc%2Fweb%2Fwiklou.git API: fixed bug 9938: Querying by revids on api.php returns the most recent revision for page of revid rather than requested revid --- diff --git a/includes/api/ApiQueryRevisions.php b/includes/api/ApiQueryRevisions.php index c07b938cf6..cb5430b836 100644 --- a/includes/api/ApiQueryRevisions.php +++ b/includes/api/ApiQueryRevisions.php @@ -122,6 +122,14 @@ class ApiQueryRevisions extends ApiQueryBase { // There is only one ID, use it $this->addWhereFld('rev_page', current(array_keys($pageSet->getGoodTitles()))); } + elseif ($revCount > 0) { + $this->validateLimit('rev_count', $revCount, 1, $userMax, $botMax); + + // Get all revision IDs + $this->addWhereFld('rev_id', array_keys($pageSet->getRevisionIDs())); + + $limit = $revCount; // assumption testing -- we should never get more then $revCount rows. + } elseif ($pageCount > 0) { // When working in multi-page non-enumeration mode, // limit to the latest revision only @@ -134,14 +142,6 @@ class ApiQueryRevisions extends ApiQueryBase { $this->addWhereFld('page_id', array_keys($pageSet->getGoodTitles())); $limit = $pageCount; // assumption testing -- we should never get more then $pageCount rows. - } - elseif ($revCount > 0) { - $this->validateLimit('rev_count', $revCount, 1, $userMax, $botMax); - - // Get all revision IDs - $this->addWhereFld('rev_id', array_keys($pageSet->getRevisionIDs())); - - $limit = $revCount; // assumption testing -- we should never get more then $revCount rows. } else ApiBase :: dieDebug(__METHOD__, 'param validation?');