From: Tim Starling Date: Sat, 15 Nov 2003 11:07:49 +0000 (+0000) Subject: Guarding divisions X-Git-Tag: 1.1.0~168 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/?a=commitdiff_plain;h=34cb0faef1bc2c87ed0f57ac9d0884584b6bf115;p=lhc%2Fweb%2Fwiklou.git Guarding divisions --- diff --git a/includes/SpecialStatistics.php b/includes/SpecialStatistics.php index 35c4f215d4..b353ecf666 100644 --- a/includes/SpecialStatistics.php +++ b/includes/SpecialStatistics.php @@ -24,8 +24,8 @@ function wfSpecialStatistics() $text = str_replace( "$2", $good, $text ); $text = str_replace( "$3", $views, $text ); $text = str_replace( "$4", $edits, $text ); - $text = str_replace( "$5", sprintf( "%.2f", $edits / $total ), $text ); - $text = str_replace( "$6", sprintf( "%.2f", $views / $edits ), $text ); + $text = str_replace( "$5", sprintf( "%.2f", $total ? $edits / $total : 0 ), $text ); + $text = str_replace( "$6", sprintf( "%.2f", $edits ? $views / $edits : 0 ), $text ); $wgOut->addHTML( $text ); $wgOut->addHTML( "

" . wfMsg( "userstats" ) . "

\n" );