r82391 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r82390‎ | r82391 | r82392 >
Date:11:20, 18 February 2011
Author:raymond
Status:ok (Comments)
Tags:
Comment:
Don't clutter the HTML source with useless class=""
Modified paths:
  • /trunk/phase3/includes/Pager.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Pager.php
@@ -868,7 +868,12 @@
869869
870870 function formatRow( $row ) {
871871 $this->mCurrentRow = $row; # In case formatValue etc need to know
872 - $s = Xml::openElement( 'tr', $this->getRowAttrs($row) );
 872+ $classArray = $this->getRowAttrs($row);
 873+ if ( $classArray['class'] === '' ) {
 874+ $s = Html::openElement( 'tr' );
 875+ } else {
 876+ $s = Html::openElement( 'tr', $classArray );
 877+ }
873878 $fieldNames = $this->getFieldNames();
874879 foreach ( $fieldNames as $field => $name ) {
875880 $value = isset( $row->$field ) ? $row->$field : null;

Follow-up revisions

RevisionCommit summaryAuthorDate
r82403Follow-up r82391 per Nikerabbit's CR: Fix it in a better wayraymond15:14, 18 February 2011
r85211MFT: r82297, r82307, r82309, r82312, r82315, r82337, r82391, r82392, r82403, ...demon21:01, 2 April 2011

Comments

#Comment by Nikerabbit (talk | contribs)   14:15, 18 February 2011

This looks fragile. Why not change getRowAttrs so that it returns sane output?

#Comment by Raymond (talk | contribs)   15:15, 18 February 2011

Thanks for CR. Changed it in r82403.

Status & tagging log