mediawiki.test: Prevent "Error: expected" from going to the real console
[lhc/web/wiklou.git] / includes / Html.php
index b3437d3..bc5cde8 100644 (file)
@@ -159,7 +159,8 @@ class Html {
        }
 
        /**
-        * Returns an HTML link element in a string styled as a button (when $wgUseMediaWikiUIEverywhere is enabled).
+        * Returns an HTML link element in a string styled as a button
+        * (when $wgUseMediaWikiUIEverywhere is enabled).
         *
         * @param string $contents The raw HTML contents of the element: *not*
         *   escaped!
@@ -178,7 +179,8 @@ class Html {
        }
 
        /**
-        * Returns an HTML link element in a string styled as a button (when $wgUseMediaWikiUIEverywhere is enabled).
+        * Returns an HTML link element in a string styled as a button
+        * (when $wgUseMediaWikiUIEverywhere is enabled).
         *
         * @param string $contents The raw HTML contents of the element: *not*
         *   escaped!
@@ -198,8 +200,7 @@ class Html {
        /**
         * Returns an HTML element in a string.  The major advantage here over
         * manually typing out the HTML is that it will escape all attribute
-        * values.  If you're hardcoding all the attributes, or there are none, you
-        * should probably just type out the html element yourself.
+        * values.
         *
         * This is quite similar to Xml::tags(), but it implements some useful
         * HTML-specific logic.  For instance, there is no $allowShortTag
@@ -258,19 +259,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(
@@ -893,7 +886,7 @@ class Html {
                                continue;
                        }
                        if ( $nsId === NS_MAIN ) {
-                               // For other namespaces use use the namespace prefix as label, but for
+                               // For other namespaces use the namespace prefix as label, but for
                                // main we don't use "" but the user message describing it (e.g. "(Main)" or "(Article)")
                                $nsName = wfMessage( 'blanknamespace' )->text();
                        } elseif ( is_int( $nsId ) ) {