Index: trunk/phase3/includes/HTMLForm.php |
— | — | @@ -313,7 +313,8 @@ |
314 | 314 | $classes[] = 'mw-htmlform-nolabel'; |
315 | 315 | $classes = implode( ' ', $classes ); |
316 | 316 | |
317 | | - $tableHtml = "<table class='$classes'><tbody>\n$tableHtml\n</tbody></table>\n"; |
| 317 | + $tableHtml = Html::rawElement( 'table', array( 'class' => $classes ), |
| 318 | + Html::rawElement( 'tbody', array(), "\n$tableHtml\n" ) ) . "\n"; |
318 | 319 | |
319 | 320 | return $subsectionHtml . "\n" . $tableHtml; |
320 | 321 | } |
Index: trunk/phase3/includes/Html.php |
— | — | @@ -232,19 +232,24 @@ |
233 | 233 | |
234 | 234 | $element = strtolower( $element ); |
235 | 235 | |
236 | | - # Simple checks using $attribDefaults |
237 | 236 | foreach ( $attribs as $attrib => $value ) { |
238 | 237 | $lcattrib = strtolower( $attrib ); |
| 238 | + $value = strval( $value ); |
239 | 239 | |
| 240 | + # Simple checks using $attribDefaults |
240 | 241 | if ( isset( $attribDefaults[$element][$lcattrib] ) && |
241 | | - $attribDefaults[$element][$lcattrib] === $value ) { |
| 242 | + $attribDefaults[$element][$lcattrib] == $value ) { |
242 | 243 | unset( $attribs[$attrib] ); |
243 | 244 | } |
| 245 | + |
| 246 | + if ( $lcattrib == 'class' && $value == '' ) { |
| 247 | + unset( $attribs[$attrib] ); |
| 248 | + } |
244 | 249 | } |
245 | 250 | |
246 | 251 | # More subtle checks |
247 | 252 | if ( $element === 'link' && isset( $attribs['type'] ) |
248 | | - && $attribs['type'] === 'text/css' ) { |
| 253 | + && strval( $attribs['type'] ) == 'text/css' ) { |
249 | 254 | unset( $attribs['type'] ); |
250 | 255 | } |
251 | 256 | if ( $element === 'select' && isset( $attribs['size'] ) ) { |
— | — | @@ -252,12 +257,12 @@ |
253 | 258 | || ( isset( $attribs['multiple'] ) && $attribs['multiple'] !== false ) |
254 | 259 | ) { |
255 | 260 | # A multi-select |
256 | | - if ( $attribs['size'] === '4' ) { |
| 261 | + if ( strval( $attribs['size'] ) == '4' ) { |
257 | 262 | unset( $attribs['size'] ); |
258 | 263 | } |
259 | 264 | } else { |
260 | 265 | # Single select |
261 | | - if ( $attribs['size'] === '1' ) { |
| 266 | + if ( strval( $attribs['size'] ) == '1' ) { |
262 | 267 | unset( $attribs['size'] ); |
263 | 268 | } |
264 | 269 | } |