* (bug 28578) API's parse module should not silently override invalid title inputs
authorSam Reed <reedy@users.mediawiki.org>
Fri, 20 May 2011 17:19:06 +0000 (17:19 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Fri, 20 May 2011 17:19:06 +0000 (17:19 +0000)
RELEASE-NOTES-1.19
includes/api/ApiParse.php

index bafa9f3..c451330 100644 (file)
@@ -77,6 +77,8 @@ production.
 * (bug 27790) add query type for querymodules to action=paraminfo
 * (bug 28963) add langbacklinks module to api
 * (bug 27593) API: add error message when sha1/sha1base36 is invalid
+* (bug 28578) API's parse module should not silently override invalid
+  title inputs
 
 === Languages updated in 1.19 ===
 
index ba90e10..71f4946 100644 (file)
@@ -155,7 +155,7 @@ class ApiParse extends ApiBase {
                        $this->text = $text;
                        $titleObj = Title::newFromText( $title );
                        if ( !$titleObj ) {
-                               $titleObj = Title::newFromText( 'API' );
+                               $this->dieUsageMsg( array( 'invalidtitle', $title ) );
                        }
                        $wgTitle = $titleObj;
 
@@ -565,6 +565,7 @@ class ApiParse extends ApiBase {
                        array( 'code' => 'missingtitle', 'info' => 'The page you specified doesn\'t exist' ),
                        array( 'code' => 'nosuchsection', 'info' => 'There is no section sectionnumber in page' ),
                        array( 'nosuchpageid' ),
+                       array( 'invalidtitle', 'title' ),
                ) );
        }