From 81be3ba123fa26c29ab157288530ffaec9d0930f Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Thu, 22 Mar 2012 21:04:56 +0100 Subject: Update to MediaWiki 1.18.2 --- includes/api/ApiMain.php | 2 +- includes/api/ApiParse.php | 7 ++++++- includes/api/ApiQueryRevisions.php | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) (limited to 'includes/api') diff --git a/includes/api/ApiMain.php b/includes/api/ApiMain.php index d24e1df2..85a43aba 100644 --- a/includes/api/ApiMain.php +++ b/includes/api/ApiMain.php @@ -581,7 +581,7 @@ class ApiMain extends ApiBase { // Die if token required, but not provided (unless there is a gettoken parameter) $salt = $module->getTokenSalt(); - if ( $salt !== false && !isset( $moduleParams['gettoken'] ) ) { + if ( $salt !== false && !$moduleParams['gettoken'] ) { if ( !isset( $moduleParams['token'] ) ) { $this->dieUsageMsg( array( 'missingparam', 'token' ) ); } else { diff --git a/includes/api/ApiParse.php b/includes/api/ApiParse.php index 6212b4ad..fbbd881b 100644 --- a/includes/api/ApiParse.php +++ b/includes/api/ApiParse.php @@ -52,6 +52,7 @@ class ApiParse extends ApiBase { if ( !is_null( $page ) && ( !is_null( $text ) || $title != 'API' ) ) { $this->dieUsage( 'The page parameter cannot be used together with the text and title parameters', 'params' ); } + $prop = array_flip( $params['prop'] ); if ( isset( $params['section'] ) ) { @@ -164,6 +165,9 @@ class ApiParse extends ApiBase { } } else { // Not $oldid, $pageid, $page. Hence based on $text + if ( is_null( $text ) ) { + $this->dieUsage( 'The text parameter should be passed with the title parameter. Should you be using the "page" parameter instead?', 'params' ); + } $this->text = $text; $titleObj = Title::newFromText( $title ); if ( !$titleObj ) { @@ -570,6 +574,7 @@ class ApiParse extends ApiBase { public function getPossibleErrors() { return array_merge( parent::getPossibleErrors(), array( array( 'code' => 'params', 'info' => 'The page parameter cannot be used together with the text and title parameters' ), + array( 'code' => 'params', 'info' => 'The text parameter should be passed with the title parameter. Should you be using the "page" parameter instead?' ), array( 'code' => 'missingrev', 'info' => 'There is no revision ID oldid' ), array( 'code' => 'permissiondenied', 'info' => 'You don\'t have permission to view deleted revisions' ), array( 'code' => 'missingtitle', 'info' => 'The page you specified doesn\'t exist' ), @@ -590,6 +595,6 @@ class ApiParse extends ApiBase { } public function getVersion() { - return __CLASS__ . ': $Id: ApiParse.php 104449 2011-11-28 15:52:04Z reedy $'; + return __CLASS__ . ': $Id: ApiParse.php 109694 2012-01-21 21:44:21Z reedy $'; } } diff --git a/includes/api/ApiQueryRevisions.php b/includes/api/ApiQueryRevisions.php index 9a1f1ba0..de7d2c2d 100644 --- a/includes/api/ApiQueryRevisions.php +++ b/includes/api/ApiQueryRevisions.php @@ -673,6 +673,6 @@ class ApiQueryRevisions extends ApiQueryBase { } public function getVersion() { - return __CLASS__ . ': $Id: ApiQueryRevisions.php 104449 2011-11-28 15:52:04Z reedy $'; + return __CLASS__ . ': $Id: ApiQueryRevisions.php 108687 2012-01-11 21:59:55Z reedy $'; } } -- cgit v1.2.2