From 1cdedb1d44c9075ce1e07ed79dbbed2cd4ee83d3 Mon Sep 17 00:00:00 2001 From: Aryeh Gregor Date: Sun, 6 Sep 2009 15:08:10 +0000 Subject: [PATCH] Fix YET ANOTHER PHP WEAK TYPING BUG Literal "0" was getting quoted. Because, of course, 0 is equal to the empty string. --- includes/Html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/Html.php b/includes/Html.php index a58459d04a..8a518df685 100644 --- a/includes/Html.php +++ b/includes/Html.php @@ -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 { -- 2.20.1