From 3059f00b3edc2a7bdda120b7d5956ce7a64471ab Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Mon, 27 Feb 2012 12:25:00 +0000 Subject: [PATCH] 2012-02-27 Miguel de Dios * include/graphs/functions_pchart.php: fixed when the var for $colors is a other thing distint to array (for example a empty string). git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5649 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 5 +++++ pandora_console/include/graphs/functions_pchart.php | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index f8a0850276..d7721e9b45 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,8 @@ +2012-02-27 Miguel de Dios + + * include/graphs/functions_pchart.php: fixed when the var for $colors is a + other thing distint to array (for example a empty string). + 2012-02-27 Juan Manuel Ramon * include/functions_graph.php: Added call to fs_error_image function diff --git a/pandora_console/include/graphs/functions_pchart.php b/pandora_console/include/graphs/functions_pchart.php index 065248bb41..ff5dbe8b03 100755 --- a/pandora_console/include/graphs/functions_pchart.php +++ b/pandora_console/include/graphs/functions_pchart.php @@ -230,7 +230,11 @@ $rgb_color = array(); if (!isset($colors)) $colors = array(); -foreach($colors as $i => $color) { +if (empty($colors)) { + $colors = array(); +} + +foreach($colors as $i => $color) { $rgb['border'] = html_html2rgb($color['border']); $rgb_color[$i]['border']['R'] = $rgb['border'][0]; $rgb_color[$i]['border']['G'] = $rgb['border'][1];