diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2013-08-12 09:28:15 +0200 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2013-08-12 09:28:15 +0200 |
commit | 08aa4418c30cfc18ccc69a0f0f9cb9e17be6c196 (patch) | |
tree | 577a29fb579188d16003a209ce2a2e9c5b0aa2bd /includes/api/ApiFormatXml.php | |
parent | cacc939b34e315b85e2d72997811eb6677996cc1 (diff) |
Update to MediaWiki 1.21.1
Diffstat (limited to 'includes/api/ApiFormatXml.php')
-rw-r--r-- | includes/api/ApiFormatXml.php | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/includes/api/ApiFormatXml.php b/includes/api/ApiFormatXml.php index 5ccf1859..b4e8e330 100644 --- a/includes/api/ApiFormatXml.php +++ b/includes/api/ApiFormatXml.php @@ -36,10 +36,6 @@ class ApiFormatXml extends ApiFormatBase { private $mIncludeNamespace = false; private $mXslt = null; - public function __construct( $main, $format ) { - parent::__construct( $main, $format ); - } - public function getMimeType() { return 'text/xml'; } @@ -92,7 +88,7 @@ class ApiFormatXml extends ApiFormatBase { * * @par Example: * @verbatim - * name='root', value = array( '_element'=>'page', 'x', 'y', 'z') + * name='root', value = array( '_element'=>'page', 'x', 'y', 'z') * @endverbatim * creates: * @verbatim @@ -105,7 +101,7 @@ class ApiFormatXml extends ApiFormatBase { * * @par Example: * @verbatim - * name='root', value = array( '*'=>'text', 'lang'=>'en', 'id'=>10) + * name='root', value = array( '*'=>'text', 'lang'=>'en', 'id'=>10) * @endverbatim * creates: * @verbatim @@ -205,7 +201,13 @@ class ApiFormatXml extends ApiFormatBase { // ignore break; default: - $retval .= $indstr . Xml::element( $elemName, null, $elemValue ); + // to make sure null value doesn't produce unclosed element, + // which is what Xml::element( $elemName, null, null ) returns + if ( $elemValue === null ) { + $retval .= $indstr . Xml::element( $elemName ); + } else { + $retval .= $indstr . Xml::element( $elemName, null, $elemValue ); + } break; } return $retval; @@ -248,8 +250,4 @@ class ApiFormatXml extends ApiFormatBase { public function getDescription() { return 'Output data in XML format' . parent::getDescription(); } - - public function getVersion() { - return __CLASS__ . ': $Id$'; - } } |