From: Aaron Schulz Date: Tue, 5 Jul 2011 22:47:21 +0000 (+0000) Subject: Division by zero X-Git-Tag: 1.31.0-rc.0~29054 X-Git-Url: http://git.cyclocoop.org/data/%24oldEdit?a=commitdiff_plain;h=83ab8b8f7f28b47fc0a116c15b15908cc873684c;p=lhc%2Fweb%2Fwiklou.git Division by zero --- diff --git a/includes/profiler/ProfilerSimpleText.php b/includes/profiler/ProfilerSimpleText.php index b049d5a139..f54b0e50f0 100644 --- a/includes/profiler/ProfilerSimpleText.php +++ b/includes/profiler/ProfilerSimpleText.php @@ -45,7 +45,8 @@ class ProfilerSimpleText extends ProfilerSimple { } static function format( $item, $key, $totalReal ) { + $perc = $totalReal ? $item['real']/$totalReal*100 : 0; self::$out .= sprintf( "%6.2f%% %3.6f %6d - %s\n", - $item['real']/$totalReal*100, $item['real'], $item['count'], $key ); + $perc, $item['real'], $item['count'], $key ); } }