r62646 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r62645‎ | r62646 | r62647 >
Date:18:23, 17 February 2010
Author:pdhanda
Status:resolved (Comments)
Tags:
Comment:
Empty string checks fixed. Display of total counts fixed.
Modified paths:
  • /trunk/extensions/CodeReview/CodeReview.i18n.php (modified) (history)
  • /trunk/extensions/CodeReview/ui/CodeRevisionListView.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CodeReview/CodeReview.i18n.php
@@ -78,7 +78,7 @@
7979 'code-rev-diff-link' => 'diff',
8080 'code-rev-diff-too-large' => 'The diff is too large to display.',
8181 'code-rev-purge-link' => 'purge',
82 - 'code-rev-total' => 'Total number of results: ',
 82+ 'code-rev-total' => 'Total number of results: $1',
8383 'code-status-new' => 'new',
8484 'code-status-fixme' => 'fixme',
8585 'code-status-reverted' => 'reverted',
Index: trunk/extensions/CodeReview/ui/CodeRevisionListView.php
@@ -50,7 +50,7 @@
5151 $pager->getNavigationBar() .
5252 $pager->getLimitForm() .
5353 '</td><td style="padding-left: 2em;">' .
54 - '&nbsp;' . wfMsgHtml( 'code-rev-total' ) . '<span style="font-weight: bold;">' . $revCount . '</span>' .
 54+ '&nbsp;<strong>' . wfMsgHtml( 'code-rev-total', $revCount ) . '</strong>' .
5555 '</td></tr></table>' .
5656 Xml::openElement( 'form',
5757 array( 'action' => $pager->getTitle()->getLocalURL(), 'method' => 'post' )
@@ -164,7 +164,7 @@
165165 $tables = array( 'code_rev' );
166166 $selectFields = array( 'COUNT( DISTINCT cr_id ) AS rev_count' );
167167 // count if code_rev where path matches
168 - if ( $this->mPath ) {
 168+ if ( strlen($this->mPath) ) {
169169 $tables[] = 'code_paths';
170170 $whereCond = array('cr_repo_id' => $this->mRepo->getId(),
171171 'cr_id = cp_rev_id',
@@ -268,7 +268,7 @@
269269
270270 function formatRevValue( $name, $value, $row ) {
271271 global $wgUser, $wgLang;
272 - $pathQuery = (empty($this->mView->mPath)) ? array() : array('path' => $this->mView->mPath);
 272+ $pathQuery = ( strlen($this->mView->mPath) ) ? array('path' => $this->mView->mPath) : array();
273273
274274 switch( $name ) {
275275 case 'selectforchange':

Follow-up revisions

RevisionCommit summaryAuthorDate
r76885* Per CR on r62646, formatNum() $revCount...demon16:15, 17 November 2010

Comments

#Comment by Nikerabbit (talk | contribs)   13:10, 17 November 2010

$revCount is neither escaped nor localized.

#Comment by 😂 (talk | contribs)   16:17, 17 November 2010

It's only an int (especially since r76885). I did fix the formatting in the followup.

Status & tagging log