From: Bryan Davis Date: Thu, 18 Dec 2014 16:29:36 +0000 (-0700) Subject: xhprof: Guard against division by 0 X-Git-Tag: 1.31.0-rc.0~12925 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/%7B%7B%20url_for%28%27admin_users%27%29%20%7D%7D?a=commitdiff_plain;h=57ce0b309db8ff0dbb7b53f80fdb8574c0bbd57f;p=lhc%2Fweb%2Fwiklou.git xhprof: Guard against division by 0 Warning: Division by zero in /srv/mediawiki/php-1.25wmf12/includes/profiler/ProfilerXhprof.php on line 143 Change-Id: Ibb3d0ce836d30663c511809b6e1dece4baa4da92 --- diff --git a/includes/profiler/ProfilerXhprof.php b/includes/profiler/ProfilerXhprof.php index e466657496..624433b4dd 100644 --- a/includes/profiler/ProfilerXhprof.php +++ b/includes/profiler/ProfilerXhprof.php @@ -145,7 +145,7 @@ class ProfilerXhprof extends Profiler { } // @note: getFunctionStats() values already in ms - $stats['%real'] = $stats['real'] / $main['real'] * 100; + $stats['%real'] = $main['real'] ? $stats['real'] / $main['real'] * 100 : 0; $stats['%cpu'] = $main['cpu'] ? $stats['cpu'] / $main['cpu'] * 100 : 0; $stats['%memory'] = $main['memory'] ? $stats['memory'] / $main['memory'] * 100 : 0; $profile[] = $stats; // assume no section names collide with $metrics