r99415 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r99414‎ | r99415 | r99416 >
Date:18:34, 10 October 2011
Author:brion
Status:ok
Tags:
Comment:
MFT r99135 -- partially undoes breakage from r88007

Per bug 31542 this got merged to 1.18wmf1 but not REL1_18.
Modified paths:
  • /branches/REL1_18/phase3/RELEASE-NOTES-1.18 (modified) (history)
  • /branches/REL1_18/phase3/includes/api/ApiFormatXml.php (modified) (history)

Diff [purge]

Index: branches/REL1_18/phase3/RELEASE-NOTES-1.18
@@ -600,6 +600,8 @@
601601 * (bug 28817) Add reference help page link to API Modules
602602 * (bug 29935) Improve formatting of examples in ApiParamInfo
603603 * (bug 29938) list=users&usprop=rights shows rights the user doesn't have
 604+* (bug 24781) The API will include an XML namespace if the includexmlnamespace
 605+ parameter is set.
604606
605607 === Languages updated in 1.18 ===
606608
Index: branches/REL1_18/phase3/includes/api/ApiFormatXml.php
@@ -38,6 +38,7 @@
3939 private $mRootElemName = 'api';
4040 public static $namespace = 'http://www.mediawiki.org/xml/api/';
4141 private $mDoubleQuote = false;
 42+ private $mIncludeNamespace = false;
4243 private $mXslt = null;
4344
4445 public function __construct( $main, $format ) {
@@ -59,15 +60,22 @@
6061 public function execute() {
6162 $params = $this->extractRequestParams();
6263 $this->mDoubleQuote = $params['xmldoublequote'];
 64+ $this->mIncludeNamespace = $params['includexmlnamespace'];
6365 $this->mXslt = $params['xslt'];
6466
6567 $this->printText( '<?xml version="1.0"?>' );
6668 if ( !is_null( $this->mXslt ) ) {
6769 $this->addXslt();
6870 }
 71+ if ( $this->mIncludeNamespace ) {
 72+ $data = array( 'xmlns' => self::$namespace ) + $this->getResultData();
 73+ } else {
 74+ $data = $this->getResultData();
 75+ }
 76+
6977 $this->printText(
7078 self::recXmlPrint( $this->mRootElemName,
71 - array( 'xmlns' => self::$namespace ) + $this->getResultData(),
 79+ $data,
7280 $this->getIsHtml() ? - 2 : null,
7381 $this->mDoubleQuote
7482 )
@@ -201,6 +209,7 @@
202210 return array(
203211 'xmldoublequote' => false,
204212 'xslt' => null,
 213+ 'includexmlnamespace' => false,
205214 );
206215 }
207216
@@ -208,6 +217,7 @@
209218 return array(
210219 'xmldoublequote' => 'If specified, double quotes all attributes and content',
211220 'xslt' => 'If specified, adds <xslt> as stylesheet',
 221+ 'includexmlnamespace' => 'If specified, adds an XML namespace'
212222 );
213223 }
214224

Follow-up revisions

RevisionCommit summaryAuthorDate
r101912* (bug 31878, bug 31542) Fix XML namespace output in API; removed now-unneede...brion23:14, 3 November 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r88007(bug 24781) Define XML namespace for API output. Also created the referenced ...catrope16:34, 13 May 2011
r99135(bug 24781) The API will include an XML namespace if the includexmlnamespace ...btongminh20:11, 6 October 2011

Status & tagging log