summaryrefslogtreecommitdiff
path: root/includes/api/ApiFormatXml.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2012-05-03 13:01:35 +0200
committerPierre Schmitz <pierre@archlinux.de>2012-05-03 13:01:35 +0200
commitd9022f63880ce039446fba8364f68e656b7bf4cb (patch)
tree16b40fbf17bf7c9ee6f4ead25b16dd192378050a /includes/api/ApiFormatXml.php
parent27cf83d177256813e2e802241085fce5dd0f3fb9 (diff)
Update to MediaWiki 1.19.0
Diffstat (limited to 'includes/api/ApiFormatXml.php')
-rw-r--r--includes/api/ApiFormatXml.php17
1 files changed, 8 insertions, 9 deletions
diff --git a/includes/api/ApiFormatXml.php b/includes/api/ApiFormatXml.php
index 06bd9f33..8f4abc15 100644
--- a/includes/api/ApiFormatXml.php
+++ b/includes/api/ApiFormatXml.php
@@ -24,11 +24,6 @@
* @file
*/
-if ( !defined( 'MEDIAWIKI' ) ) {
- // Eclipse helper - will be ignored in production
- require_once( 'ApiFormatBase.php' );
-}
-
/**
* API XML output formatter
* @ingroup API
@@ -68,11 +63,15 @@ class ApiFormatXml extends ApiFormatBase {
$this->addXslt();
}
if ( $this->mIncludeNamespace ) {
- $data = array( 'xmlns' => self::$namespace ) + $this->getResultData();
+ // If the result data already contains an 'xmlns' namespace added
+ // for custom XML output types, it will override the one for the
+ // generic API results.
+ // This allows API output of other XML types like Atom, RSS, RSD.
+ $data = $this->getResultData() + array( 'xmlns' => self::$namespace );
} else {
$data = $this->getResultData();
}
-
+
$this->printText(
self::recXmlPrint( $this->mRootElemName,
$data,
@@ -94,7 +93,7 @@ class ApiFormatXml extends ApiFormatBase {
*
* If neither key is found, all keys become element names, and values become element content.
* The method is recursive, so the same rules apply to any sub-arrays.
- *
+ *
* @param $elemName
* @param $elemValue
* @param $indent
@@ -202,7 +201,7 @@ class ApiFormatXml extends ApiFormatBase {
$this->setWarning( 'Stylesheet should have .xsl extension.' );
return;
}
- $this->printText( '<?xml-stylesheet href="' . $nt->escapeLocalURL( 'action=raw' ) . '" type="text/xsl" ?>' );
+ $this->printText( '<?xml-stylesheet href="' . htmlspecialchars( $nt->getLocalURL( 'action=raw' ) ) . '" type="text/xsl" ?>' );
}
public function getAllowedParams() {