Fix "Invalid argument for foreach()" in Html
authorAryeh Gregor <simetrical@users.mediawiki.org>
Tue, 22 Sep 2009 17:41:34 +0000 (17:41 +0000)
committerAryeh Gregor <simetrical@users.mediawiki.org>
Tue, 22 Sep 2009 17:41:34 +0000 (17:41 +0000)
Reported by Nikerabbit on IRC to happen on Preferences, although I
couldn't reproduce immediately.  The change should be helpful for this
kind of thing anyway.

includes/Html.php

index 068a9bf..821822c 100644 (file)
@@ -107,6 +107,7 @@ class Html {
         */
        public static function rawElement( $element, $attribs = array(), $contents = '' ) {
                global $wgHtml5, $wgWellFormedXml;
+               $attribs = (array)$attribs;
                # This is not required in HTML 5, but let's do it anyway, for
                # consistency and better compression.
                $element = strtolower( $element );