r93905 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r93904‎ | r93905 | r93906 >
Date:20:04, 4 August 2011
Author:reedy
Status:ok
Tags:
Comment:
* (bug 30230) action=expandtemplates should not silently override invalid title inputs
Modified paths:
  • /trunk/phase3/RELEASE-NOTES-1.19 (modified) (history)
  • /trunk/phase3/includes/api/ApiExpandTemplates.php (modified) (history)

Diff [purge]

Index: trunk/phase3/RELEASE-NOTES-1.19
@@ -44,6 +44,7 @@
4545 * (bug 29685) do not output NULL parentid with list=deletedrevs&drprop=parentid.
4646 * siprop=interwikimap and siprop=languages can use silanguagecode to have
4747 a best effort language name translation. Use CLDR extension for best result.
 48+* (bug 30230) action=expandtemplates should not silently override invalid title inputs
4849
4950 === Languages updated in 1.19 ===
5051
Index: trunk/phase3/includes/api/ApiExpandTemplates.php
@@ -52,7 +52,7 @@
5353 // Create title for parser
5454 $title_obj = Title::newFromText( $params['title'] );
5555 if ( !$title_obj ) {
56 - $title_obj = Title::newFromText( 'API' ); // default
 56+ $this->dieUsageMsg( array( 'invalidtitle', $params['title'] ) );
5757 }
5858
5959 $result = $this->getResult();
@@ -109,6 +109,12 @@
110110 return 'Expands all templates in wikitext';
111111 }
112112
 113+ public function getPossibleErrors() {
 114+ return array_merge( parent::getPossibleErrors(), array(
 115+ array( 'invalidtitle', 'title' ),
 116+ ) );
 117+ }
 118+
113119 protected function getExamples() {
114120 return array(
115121 'api.php?action=expandtemplates&text={{Project:Sandbox}}'

Follow-up revisions

RevisionCommit summaryAuthorDate
r93977Followup r93905 per comment on bug 30230...reedy14:55, 5 August 2011

Status & tagging log