From: Roan Kattouw Date: Fri, 9 Apr 2010 12:31:27 +0000 (+0000) Subject: Fix division by zero in Profiler X-Git-Tag: 1.31.0-rc.0~37207 X-Git-Url: http://git.cyclocoop.org/url?a=commitdiff_plain;h=cb480c416cc500f47587817dc519b33f6fd790f2;p=lhc%2Fweb%2Fwiklou.git Fix division by zero in Profiler --- 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 ){