From e0782a7522c489a0a5565c51e1aa328804e48a1c Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Wed, 12 Jun 2013 16:09:10 +0000 Subject: [PATCH] 2013-06-12 Miguel de Dios * include/functions_reporting.php: fixed the empty serialize vars. Fixes: #2276 MERGED FROM THE BRANCH PANDORA_4.0 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8305 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 8 ++++++++ .../include/functions_reporting.php | 18 ++++++++++-------- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index de218534d1..c366b0f6ac 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,11 @@ +2013-06-12 Miguel de Dios + + * include/functions_reporting.php: fixed the empty serialize vars. + + Fixes: #2276 + + MERGED FROM THE BRANCH PANDORA_4.0 + 2013-06-12 Miguel de Dios * operation/tree.php: improved the source code style. diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index cbe17106c9..b132aef681 100644 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -4184,16 +4184,18 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f foreach ($result as $row) { $date = date ($config["date_format"], $row['utimestamp']); $serialized = $row['datos']; - - $rowsUnserialize = (array)$serialized; - if (!empty($content['line_separator'])) { - $rowsUnserialize = explode($line_separator, - $serialized); + if (empty($content['line_separator']) || + empty($serialized)) { + $rowsUnserialize = array($row['datos']); + } + else { + $rowsUnserialize = explode($content['line_separator'], $serialized); } - foreach ($rowsUnserialize as $rowUnser) { - $columnsUnserialize = (array)$rowUnser; - if (!empty($content['column_separator'])) { + if (empty($content['column_separator'])) { + $columnsUnserialize = array($rowUnser); + } + else { $columnsUnserialize = explode($content['column_separator'], $rowUnser); }