From 4ac9fa081a7c045f6a9f1cfc529d82423f485b2e Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sun, 8 Dec 2013 09:55:49 +0100 Subject: Update to MediaWiki 1.22.0 --- includes/Html.php | 179 ++++++++++++++++++------------------------------------ 1 file changed, 59 insertions(+), 120 deletions(-) (limited to 'includes/Html.php') diff --git a/includes/Html.php b/includes/Html.php index af4b4bbf..932f753e 100644 --- a/includes/Html.php +++ b/includes/Html.php @@ -36,8 +36,8 @@ * * There are two important configuration options this class uses: * - * $wgHtml5: If this is set to false, then all output should be valid XHTML 1.0 - * Transitional. + * $wgMimeType: If this is set to an xml mimetype then output should be + * valid XHTML5. * $wgWellFormedXml: If this is set to true, then all output should be * well-formed XML (quotes on attributes, self-closing tags, etc.). * @@ -101,19 +101,6 @@ class Html { 'itemscope', ); - private static $HTMLFiveOnlyAttribs = array( - 'autocomplete', - 'autofocus', - 'max', - 'min', - 'multiple', - 'pattern', - 'placeholder', - 'required', - 'step', - 'spellcheck', - ); - /** * Returns an HTML element in a string. The major advantage here over * manually typing out the HTML is that it will escape all attribute @@ -177,7 +164,7 @@ class Html { * @return string */ public static function openElement( $element, $attribs = array() ) { - global $wgHtml5, $wgWellFormedXml; + global $wgWellFormedXml; $attribs = (array)$attribs; // This is not required in HTML5, but let's do it anyway, for // consistency and better compression. @@ -185,7 +172,7 @@ class Html { // In text/html, initial and tags can be omitted under // pretty much any sane circumstances, if they have no attributes. See: - // + // if ( !$wgWellFormedXml && !$attribs && in_array( $element, array( 'html', 'head' ) ) ) { return ''; @@ -204,36 +191,28 @@ class Html { 'image', 'reset', 'button', - ); - // Allow more input types in HTML5 mode - if( $wgHtml5 ) { - $validTypes = array_merge( $validTypes, array( - 'datetime', - 'datetime-local', - 'date', - 'month', - 'time', - 'week', - 'number', - 'range', - 'email', - 'url', - 'search', - 'tel', - 'color', - ) ); - } + // HTML input types + 'datetime', + 'datetime-local', + 'date', + 'month', + 'time', + 'week', + 'number', + 'range', + 'email', + 'url', + 'search', + 'tel', + 'color', + ); if ( isset( $attribs['type'] ) && !in_array( $attribs['type'], $validTypes ) ) { unset( $attribs['type'] ); } } - if ( !$wgHtml5 && $element == 'textarea' && isset( $attribs['maxlength'] ) ) { - unset( $attribs['maxlength'] ); - } - // According to standard the default type for