raise timeout for CdbTest::testCdb()
[lhc/web/wiklou.git] / includes / api / ApiFormatXml.php
index 5ccf185..8dbeae4 100644 (file)
@@ -205,7 +205,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 +254,4 @@ class ApiFormatXml extends ApiFormatBase {
        public function getDescription() {
                return 'Output data in XML format' . parent::getDescription();
        }
-
-       public function getVersion() {
-               return __CLASS__ . ': $Id$';
-       }
 }