Use Html::rawElement() instead of hardcoded string in Special:Contributions
authorAlexandre Emsenhuber <ialex.wiki@gmail.com>
Sat, 29 Dec 2012 15:47:22 +0000 (16:47 +0100)
committerAlexandre Emsenhuber <ialex.wiki@gmail.com>
Sat, 29 Dec 2012 15:47:22 +0000 (16:47 +0100)
Since there is generally no classes in the list items, this avoids having a
lot of useless class="" in the output.

Change-Id: I804af2269def1f06d023145c9ced6f1afa0d0c71

includes/specials/SpecialContributions.php

index b6fea02..8bef55c 100644 (file)
@@ -946,12 +946,11 @@ class ContribsPager extends ReverseChronologicalPager {
                // Let extensions add data
                wfRunHooks( 'ContributionsLineEnding', array( $this, &$ret, $row, &$classes ) );
 
-               $classes = implode( ' ', $classes );
-               if ( $classes === '' && $ret === '' ) {
+               if ( $classes === array() && $ret === '' ) {
                        wfDebug( 'Dropping Special:Contribution row that could not be formatted' );
                        $ret = "<!-- Could not format Special:Contribution row. -->\n";
                } else {
-                       $ret = "<li class=\"$classes\">$ret</li>\n";
+                       $ret = Html::rawElement( 'li', array( 'class' => $classes ), $ret ) . "\n";
                }
 
                wfProfileOut( __METHOD__ );