aaand restore behavior from prior to r24882 on expected input
authorBrion Vibber <brion@users.mediawiki.org>
Mon, 20 Aug 2007 13:46:08 +0000 (13:46 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Mon, 20 Aug 2007 13:46:08 +0000 (13:46 +0000)
includes/Xml.php

index 2082d68..d7261a1 100644 (file)
@@ -42,13 +42,15 @@ class Xml {
         */
        private static function expandAttributes( $attribs ) {
                $out = '';
-               if( is_array( $attribs ) ) {
+               if( is_null( $attribs ) ) {
+                       return null;
+               } elseif( is_array( $attribs ) ) {
                        foreach( $attribs as $name => $val )
                                $out .= " {$name}=\"" . Sanitizer::encodeAttribute( $val ) . '"';
+                       return $out;
                } else {
                        throw new MWException( 'Expected attribute array, got something else in ' . __METHOD__ );
                }
-               return $out;
        }
 
        /**