From cb480c416cc500f47587817dc519b33f6fd790f2 Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Fri, 9 Apr 2010 12:31:27 +0000 Subject: [PATCH] Fix division by zero in Profiler --- includes/Profiler.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/Profiler.php b/includes/Profiler.php index f91fcf9d03..4c4aa2475f 100644 --- a/includes/Profiler.php +++ b/includes/Profiler.php @@ -284,9 +284,9 @@ class Profiler { $overheadInternal[] = $elapsed; } } - $overheadTotal = array_sum( $overheadTotal ) / count( $overheadInternal ); - $overheadMemory = array_sum( $overheadMemory ) / count( $overheadInternal ); - $overheadInternal = array_sum( $overheadInternal ) / count( $overheadInternal ); + $overheadTotal = $overheadTotal ? array_sum( $overheadTotal ) / count( $overheadInternal ) : 0; + $overheadMemory = $overheadMemory ? array_sum( $overheadMemory ) / count( $overheadInternal ) : 0; + $overheadInternal = $overheadInternal ? array_sum( $overheadInternal ) / count( $overheadInternal ) : 0; # Collate foreach( $this->mStack as $index => $entry ){ -- 2.20.1