summaryrefslogtreecommitdiff
path: root/includes/api/ApiParse.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/api/ApiParse.php')
-rw-r--r--includes/api/ApiParse.php7
1 files changed, 6 insertions, 1 deletions
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 $';
}
}