Merge "Made LinksUpdate::updateLinksTimestamp() use a more correct timestamp"
[lhc/web/wiklou.git] / includes / api / ApiFormatXml.php
index 0917ac7..764e609 100644 (file)
@@ -156,11 +156,19 @@ class ApiFormatXml extends ApiFormatBase {
                                } elseif ( is_array( $subElemValue ) ) {
                                        $subElements[$subElemId] = $subElemValue;
                                        unset( $elemValue[$subElemId] );
+                               } elseif ( is_bool( $subElemValue ) ) {
+                                       // treat true as empty string, skip false in xml format
+                                       if ( $subElemValue === true ) {
+                                               $subElemValue = '';
+                                       } else {
+                                               unset( $elemValue[$subElemId] );
+                                       }
                                }
                        }
 
                        if ( is_null( $subElemIndName ) && count( $indElements ) ) {
-                               ApiBase::dieDebug( __METHOD__, "($elemName, ...) has integer keys without _element value. Use ApiResult::setIndexedTagName()." );
+                               ApiBase::dieDebug( __METHOD__, "($elemName, ...) has integer keys " .
+                                       "without _element value. Use ApiResult::setIndexedTagName()." );
                        }
 
                        if ( count( $subElements ) && count( $indElements ) && !is_null( $subElemContent ) ) {
@@ -214,7 +222,8 @@ class ApiFormatXml extends ApiFormatBase {
 
                        return;
                }
-               $this->printText( '<?xml-stylesheet href="' . htmlspecialchars( $nt->getLocalURL( 'action=raw' ) ) . '" type="text/xsl" ?>' );
+               $this->printText( '<?xml-stylesheet href="' .
+                       htmlspecialchars( $nt->getLocalURL( 'action=raw' ) ) . '" type="text/xsl" ?>' );
        }
 
        public function getAllowedParams() {