From: Sam Reed Date: Fri, 20 May 2011 17:19:06 +0000 (+0000) Subject: * (bug 28578) API's parse module should not silently override invalid title inputs X-Git-Tag: 1.31.0-rc.0~30063 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;h=92c4ceb6bb19b967fd0c2c39d880ddf994e944ba;p=lhc%2Fweb%2Fwiklou.git * (bug 28578) API's parse module should not silently override invalid title inputs --- diff --git a/RELEASE-NOTES-1.19 b/RELEASE-NOTES-1.19 index bafa9f36be..c4513302ef 100644 --- a/RELEASE-NOTES-1.19 +++ b/RELEASE-NOTES-1.19 @@ -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 === diff --git a/includes/api/ApiParse.php b/includes/api/ApiParse.php index ba90e10e3e..71f4946926 100644 --- a/includes/api/ApiParse.php +++ b/includes/api/ApiParse.php @@ -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' ), ) ); }