From 3cbc71f7bd0a45ca6eeeff8b9b1e595cf2c0bac8 Mon Sep 17 00:00:00 2001 From: Tom Laermans Date: Fri, 4 Mar 2011 17:54:12 +0000 Subject: [PATCH] Fix division by zero for broken storage, found by Corentin Chary git-svn-id: http://www.observium.org/svn/observer/trunk@1792 61d68cd4-352d-0410-923a-c4978735b2b8 --- includes/polling/storage.inc.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/includes/polling/storage.inc.php b/includes/polling/storage.inc.php index 9ff8c5c0d..30ce5318e 100755 --- a/includes/polling/storage.inc.php +++ b/includes/polling/storage.inc.php @@ -39,7 +39,14 @@ while($storage = mysql_fetch_array($storage_data)) { if($debug) {print_r($storage);} - $percent = round($storage['used'] / $storage['size'] * 100); + if ($storage['size']) + { + $percent = round($storage['used'] / $storage['size'] * 100); + } + else + { + $percent = 0; + } echo($percent."% ");