From a5f8a9ca24f76c7e1b87f6b1b3cefc568c4fa141 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Mon, 11 Jan 2016 14:02:00 +0100 Subject: [PATCH] Fixed the PHP warnings that burns the file systems. TICKET: #3054 --- pandora_console/include/db/mysql.php | 2 +- pandora_console/include/graphs/pChart/pDraw.class.php | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/db/mysql.php b/pandora_console/include/db/mysql.php index 2fb46b176d..00a49395db 100644 --- a/pandora_console/include/db/mysql.php +++ b/pandora_console/include/db/mysql.php @@ -30,7 +30,7 @@ function mysql_connect_db($host = null, $db = null, $user = null, $pass = null, // Non-persistent connection: This will help to avoid mysql errors like "has gone away" or locking problems // If you want persistent connections change it to mysql_pconnect(). - $connect_id = mysql_connect($host . ":" . $port, $user, $pass, true); + $connect_id = @mysql_connect($host . ":" . $port, $user, $pass, true); if (! $connect_id) { return false; } diff --git a/pandora_console/include/graphs/pChart/pDraw.class.php b/pandora_console/include/graphs/pChart/pDraw.class.php index 13efd86886..814f4ec824 100755 --- a/pandora_console/include/graphs/pChart/pDraw.class.php +++ b/pandora_console/include/graphs/pChart/pDraw.class.php @@ -2546,10 +2546,17 @@ return($Scale); } + function mod_check($x, $y) { + return @($x % $y) === FALSE; + } + function modulo($Value1,$Value2) { if (floor($Value1) == 0) { return(0); } if (floor($Value2) == 0) { return(0); } + if (is_infinite($Value2)) { return(0); } + if ($Value2 == 0.0) { return(0); } + if ($this->mod_check($Value1, $Value2)) { return(0); } if (floor($Value2) != 0) { return($Value1 % $Value2); } $MinValue = min($Value1,$Value2); $Factor = 10;