From 34cb0faef1bc2c87ed0f57ac9d0884584b6bf115 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Sat, 15 Nov 2003 11:07:49 +0000 Subject: [PATCH] Guarding divisions --- includes/SpecialStatistics.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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" ); -- 2.20.1