Fix YET ANOTHER PHP WEAK TYPING BUG
authorAryeh Gregor <simetrical@users.mediawiki.org>
Sun, 6 Sep 2009 15:08:10 +0000 (15:08 +0000)
committerAryeh Gregor <simetrical@users.mediawiki.org>
Sun, 6 Sep 2009 15:08:10 +0000 (15:08 +0000)
Literal "0" was getting quoted.  Because, of course, 0 is equal to the
empty string.

includes/Html.php

index a58459d..8a518df 100644 (file)
@@ -237,7 +237,7 @@ class Html {
                        # marks omitted, but not all.  (Although a literal " is not
                        # permitted, we don't check for that, since it will be escaped
                        # anyway.)
-                       if ( $wgWellFormedXml || $value == ''
+                       if ( $wgWellFormedXml || $value === ''
                        || preg_match( "/[ '=<>]/", $value ) ) {
                                $quote = '"';
                        } else {