Html::openElement: Don't omit closing tags.
authorRicordisamoa <ricordisamoa@openmailbox.org>
Wed, 18 Feb 2015 21:35:22 +0000 (22:35 +0100)
committerRicordisamoa <ricordisamoa@openmailbox.org>
Wed, 18 Feb 2015 21:35:22 +0000 (22:35 +0100)
Logic added with commit eefe1b13a382a7d11c2137bbf900b783ee445323
for both openElement and closeElement, removed with commit
d950da075dcb6c6dd3f68a50a0d427569350763a but only from closeElement.

Reported by Petr Bena on Wikitech-l:
https://lists.wikimedia.org/pipermail/wikitech-l/2015-February/080861.html

Change-Id: I6ed45763f7e95f7f39b73432e4f6152431891963

includes/Html.php

index 93a1a04..fe8f57e 100644 (file)
@@ -257,19 +257,11 @@ class Html {
         * @return string
         */
        public static function openElement( $element, $attribs = array() ) {
-               global $wgWellFormedXml;
                $attribs = (array)$attribs;
                // This is not required in HTML5, but let's do it anyway, for
                // consistency and better compression.
                $element = strtolower( $element );
 
-               // In text/html, initial <html> and <head> tags can be omitted under
-               // pretty much any sane circumstances, if they have no attributes.  See:
-               // <http://www.whatwg.org/html/syntax.html#optional-tags>
-               if ( !$wgWellFormedXml && !$attribs && in_array( $element, array( 'html', 'head' ) ) ) {
-                       return '';
-               }
-
                // Remove invalid input types
                if ( $element == 'input' ) {
                        $validTypes = array(