r53473 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r53472‎ | r53473 | r53474 >
Date:11:46, 19 July 2009
Author:siebrand
Status:deferred
Tags:
Comment:
Division by 0 should not be possible as it means that a collection has 0 messages, but does ooccur. Caching issue?
Modified paths:
  • /trunk/extensions/Translate/SpecialLanguageStats.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/SpecialLanguageStats.php
@@ -210,8 +210,9 @@
211211 continue;
212212 }
213213
214 - $translatedPercentage = $wgLang->formatNum( round( 100 * $translated / $total, 2 ) );
215 - $fuzzyPercentage = $wgLang->formatNum( round( 100 * $fuzzy / $total, 2 ) );
 214+ // Division by 0 should not be possible, but does ooccur. Caching issue?
 215+ $translatedPercentage = $total ? $wgLang->formatNum( round( 100 * $translated / $total, 2 ) ) : '<error>';
 216+ $fuzzyPercentage = $total ? $wgLang->formatNum( round( 100 * $fuzzy / $total, 2 ) ) : '<error>';
216217
217218 if ( !wfEmptyMsg( 'percent', wfMsgNoTrans('percent')) ) {
218219 $translatedPercentage = wfMsg( 'percent', $translatedPercentage );

Status & tagging log