From: Sam Reed Date: Thu, 4 Aug 2011 20:04:09 +0000 (+0000) Subject: * (bug 30230) action=expandtemplates should not silently override invalid title inputs X-Git-Tag: 1.31.0-rc.0~28440 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=175bd072beec24eb2e01a6f7d613189093aff32d;p=lhc%2Fweb%2Fwiklou.git * (bug 30230) action=expandtemplates should not silently override invalid title inputs --- diff --git a/RELEASE-NOTES-1.19 b/RELEASE-NOTES-1.19 index 70ec5a916c..db0797a1be 100644 --- a/RELEASE-NOTES-1.19 +++ b/RELEASE-NOTES-1.19 @@ -44,6 +44,7 @@ production. * (bug 29685) do not output NULL parentid with list=deletedrevs&drprop=parentid. * siprop=interwikimap and siprop=languages can use silanguagecode to have a best effort language name translation. Use CLDR extension for best result. +* (bug 30230) action=expandtemplates should not silently override invalid title inputs === Languages updated in 1.19 === diff --git a/includes/api/ApiExpandTemplates.php b/includes/api/ApiExpandTemplates.php index d771ea1135..fc9a4518da 100644 --- a/includes/api/ApiExpandTemplates.php +++ b/includes/api/ApiExpandTemplates.php @@ -52,7 +52,7 @@ class ApiExpandTemplates extends ApiBase { // Create title for parser $title_obj = Title::newFromText( $params['title'] ); if ( !$title_obj ) { - $title_obj = Title::newFromText( 'API' ); // default + $this->dieUsageMsg( array( 'invalidtitle', $params['title'] ) ); } $result = $this->getResult(); @@ -109,6 +109,12 @@ class ApiExpandTemplates extends ApiBase { return 'Expands all templates in wikitext'; } + public function getPossibleErrors() { + return array_merge( parent::getPossibleErrors(), array( + array( 'invalidtitle', 'title' ), + ) ); + } + protected function getExamples() { return array( 'api.php?action=expandtemplates&text={{Project:Sandbox}}'