Index: trunk/phase3/includes/Xml.php |
— | — | @@ -42,13 +42,15 @@ |
43 | 43 | */ |
44 | 44 | private static function expandAttributes( $attribs ) { |
45 | 45 | $out = ''; |
46 | | - if( is_array( $attribs ) ) { |
| 46 | + if( is_null( $attribs ) ) { |
| 47 | + return null; |
| 48 | + } elseif( is_array( $attribs ) ) { |
47 | 49 | foreach( $attribs as $name => $val ) |
48 | 50 | $out .= " {$name}=\"" . Sanitizer::encodeAttribute( $val ) . '"'; |
| 51 | + return $out; |
49 | 52 | } else { |
50 | 53 | throw new MWException( 'Expected attribute array, got something else in ' . __METHOD__ ); |
51 | 54 | } |
52 | | - return $out; |
53 | 55 | } |
54 | 56 | |
55 | 57 | /** |