From 92c4ceb6bb19b967fd0c2c39d880ddf994e944ba Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Fri, 20 May 2011 17:19:06 +0000 Subject: [PATCH] * (bug 28578) API's parse module should not silently override invalid title inputs --- RELEASE-NOTES-1.19 | 2 ++ includes/api/ApiParse.php | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) 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' ), ) ); } -- 2.20.1