From: Aryeh Gregor Date: Mon, 7 Sep 2009 15:25:22 +0000 (+0000) Subject: Fix silly X-Git-Tag: 1.31.0-rc.0~39881 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/journal.php?a=commitdiff_plain;h=f03c53b8a7a9dac33d3ef9947bf2fe5b6c354c9f;p=lhc%2Fweb%2Fwiklou.git Fix silly
--- diff --git a/includes/HTMLForm.php b/includes/HTMLForm.php index d66f859907..a3b7ca64ee 100644 --- a/includes/HTMLForm.php +++ b/includes/HTMLForm.php @@ -313,7 +313,8 @@ class HTMLForm { $classes[] = 'mw-htmlform-nolabel'; $classes = implode( ' ', $classes ); - $tableHtml = "
\n$tableHtml\n
\n"; + $tableHtml = Html::rawElement( 'table', array( 'class' => $classes ), + Html::rawElement( 'tbody', array(), "\n$tableHtml\n" ) ) . "\n"; return $subsectionHtml . "\n" . $tableHtml; } diff --git a/includes/Html.php b/includes/Html.php index 089e3f7980..bece509482 100644 --- a/includes/Html.php +++ b/includes/Html.php @@ -232,19 +232,24 @@ class Html { $element = strtolower( $element ); - # Simple checks using $attribDefaults foreach ( $attribs as $attrib => $value ) { $lcattrib = strtolower( $attrib ); + $value = strval( $value ); + # Simple checks using $attribDefaults if ( isset( $attribDefaults[$element][$lcattrib] ) && - $attribDefaults[$element][$lcattrib] === $value ) { + $attribDefaults[$element][$lcattrib] == $value ) { + unset( $attribs[$attrib] ); + } + + if ( $lcattrib == 'class' && $value == '' ) { unset( $attribs[$attrib] ); } } # More subtle checks if ( $element === 'link' && isset( $attribs['type'] ) - && $attribs['type'] === 'text/css' ) { + && strval( $attribs['type'] ) == 'text/css' ) { unset( $attribs['type'] ); } if ( $element === 'select' && isset( $attribs['size'] ) ) { @@ -252,12 +257,12 @@ class Html { || ( isset( $attribs['multiple'] ) && $attribs['multiple'] !== false ) ) { # A multi-select - if ( $attribs['size'] === '4' ) { + if ( strval( $attribs['size'] ) == '4' ) { unset( $attribs['size'] ); } } else { # Single select - if ( $attribs['size'] === '1' ) { + if ( strval( $attribs['size'] ) == '1' ) { unset( $attribs['size'] ); } }