X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;ds=sidebyside;f=includes%2FHtml.php;h=2ab606912a9ba4ee41acca7656f5c31e33444416;hb=720a6824257ff1af1559efebee98a1b0debd98d9;hp=f4a3b55571f5f196ed2c0719debfaff8489cff5e;hpb=2bc2e0b254be92b9161dc18733408e99608cd1d3;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Html.php b/includes/Html.php index f4a3b55571..2ab606912a 100644 --- a/includes/Html.php +++ b/includes/Html.php @@ -48,7 +48,7 @@ * @since 1.16 */ class Html { - # List of void elements from HTML5, section 8.1.2 as of 2011-08-12 + // List of void elements from HTML5, section 8.1.2 as of 2011-08-12 private static $voidElements = array( 'area', 'base', @@ -68,8 +68,8 @@ class Html { 'wbr', ); - # Boolean attributes, which may have the value omitted entirely. Manually - # collected from the HTML5 spec as of 2011-08-12. + // Boolean attributes, which may have the value omitted entirely. Manually + // collected from the HTML5 spec as of 2011-08-12. private static $boolAttribs = array( 'async', 'autofocus', @@ -97,7 +97,7 @@ class Html { 'selected', 'truespeed', 'typemustmatch', - # HTML5 Microdata + // HTML5 Microdata 'itemscope', ); @@ -139,7 +139,7 @@ class Html { $start = self::openElement( $element, $attribs ); if ( in_array( $element, self::$voidElements ) ) { if ( $wgWellFormedXml ) { - # Silly XML. + // Silly XML. return substr( $start, 0, -1 ) . ' />'; } return $start; @@ -160,8 +160,8 @@ class Html { */ public static function element( $element, $attribs = array(), $contents = '' ) { return self::rawElement( $element, $attribs, strtr( $contents, array( - # There's no point in escaping quotes, >, etc. in the contents of - # elements. + // There's no point in escaping quotes, >, etc. in the contents of + // elements. '&' => '&', '<' => '<' ) ) ); @@ -179,19 +179,19 @@ class Html { public static function openElement( $element, $attribs = array() ) { global $wgHtml5, $wgWellFormedXml; $attribs = (array)$attribs; - # This is not required in HTML5, but let's do it anyway, for - # consistency and better compression. + // This is not required in HTML5, but let's do it anyway, for + // consistency and better compression. $element = strtolower( $element ); - # In text/html, initial and tags can be omitted under - # pretty much any sane circumstances, if they have no attributes. See: - # + // 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 ''; } - # Remove invalid input types + // Remove invalid input types if ( $element == 'input' ) { $validTypes = array( 'hidden', @@ -206,7 +206,7 @@ class Html { 'button', ); - # Allow more input types in HTML5 mode + // Allow more input types in HTML5 mode if( $wgHtml5 ) { $validTypes = array_merge( $validTypes, array( 'datetime', @@ -234,6 +234,13 @@ class Html { unset( $attribs['maxlength'] ); } + // According to standard the default type for