From 69653bd24745c7977bc9a2279ca12508ab82c598 Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Mon, 25 Feb 2008 14:12:55 +0000 Subject: [PATCH] API: Fixing limit=max output; previous implementation threw fatal errors under certain conditions and didn't accomodate for some modules having different limits in some cases. --- includes/api/ApiBase.php | 2 +- includes/api/ApiQueryRevisions.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/api/ApiBase.php b/includes/api/ApiBase.php index 001cdd4870..5551b01e56 100644 --- a/includes/api/ApiBase.php +++ b/includes/api/ApiBase.php @@ -452,7 +452,7 @@ abstract class ApiBase { if( $value == 'max' ) { if( $parseMaxLimit ) { $value = $this->getMain()->canApiHighLimits() ? $paramSettings[self :: PARAM_MAX2] : $paramSettings[self :: PARAM_MAX]; - $this->getResult()->addValue( 'limits', 'limit', $value ); + $this->getResult()->addValue( 'limits', $this->getModuleName(), $value ); $this->validateLimit($paramName, $value, $min, $paramSettings[self :: PARAM_MAX], $paramSettings[self :: PARAM_MAX2]); } } diff --git a/includes/api/ApiQueryRevisions.php b/includes/api/ApiQueryRevisions.php index 3dff0bc093..c93aefc88d 100644 --- a/includes/api/ApiQueryRevisions.php +++ b/includes/api/ApiQueryRevisions.php @@ -124,7 +124,7 @@ class ApiQueryRevisions extends ApiQueryBase { $botMax = ( $this->fld_content ? ApiBase::LIMIT_SML2 : ApiBase::LIMIT_BIG2 ); if( $limit == 'max' ) { $limit = $this->getMain()->canApiHighLimits() ? $botMax : $userMax; - $this->getResult()->addValue( 'limits', 'limit', $limit ); + $this->getResult()->addValue( 'limits', $this->getModuleName(), $limit ); } if ($enumRevMode) { -- 2.20.1