From 175bd072beec24eb2e01a6f7d613189093aff32d Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Thu, 4 Aug 2011 20:04:09 +0000 Subject: [PATCH] * (bug 30230) action=expandtemplates should not silently override invalid title inputs --- RELEASE-NOTES-1.19 | 1 + includes/api/ApiExpandTemplates.php | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) 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}}' -- 2.20.1