From 83ab8b8f7f28b47fc0a116c15b15908cc873684c Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Tue, 5 Jul 2011 22:47:21 +0000 Subject: [PATCH] Division by zero --- includes/profiler/ProfilerSimpleText.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 ); } } -- 2.20.1