aboutsummaryrefslogtreecommitdiffstats
path: root/config/mailreport/mail_reports_generate.php
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2013-10-29 08:52:08 -0400
committerjim-p <jimp@pfsense.org>2013-10-29 09:05:27 -0400
commit25147efff43f4aa9971e3026a06afe12898d1984 (patch)
tree434943068515db3f6b08c9ef68cda48258db90d4 /config/mailreport/mail_reports_generate.php
parent03ccade9e371e64b4911e1f8dd9a9e0234d8f0cd (diff)
downloadpfsense-packages-25147efff43f4aa9971e3026a06afe12898d1984.tar.gz
pfsense-packages-25147efff43f4aa9971e3026a06afe12898d1984.tar.bz2
pfsense-packages-25147efff43f4aa9971e3026a06afe12898d1984.zip
Mail Reports: Ensure some variables are actually arrays before using them, avoids an error and some console output if certain portions of a report have never been used. Version bump.
Diffstat (limited to 'config/mailreport/mail_reports_generate.php')
-rw-r--r--config/mailreport/mail_reports_generate.php18
1 files changed, 15 insertions, 3 deletions
diff --git a/config/mailreport/mail_reports_generate.php b/config/mailreport/mail_reports_generate.php
index a784c596..c31909c9 100644
--- a/config/mailreport/mail_reports_generate.php
+++ b/config/mailreport/mail_reports_generate.php
@@ -53,9 +53,21 @@ if (!$config['mailreports']['schedule'][$id])
exit;
$thisreport = $config['mailreports']['schedule'][$id];
-$cmds = $thisreport['cmd']['row'];
-$logs = $thisreport['log']['row'];
-$graphs = $thisreport['row'];
+
+if (is_array($thisreport['cmd']) && is_array($thisreport['cmd']['row']))
+ $cmds = $thisreport['cmd']['row'];
+else
+ $cmds = array();
+
+if (is_array($thisreport['log']) && is_array($thisreport['log']['row']))
+ $logs = $thisreport['log']['row'];
+else
+ $logs = array();
+
+if (is_array($thisreport['row']))
+ $graphs = $thisreport['row'];
+else
+ $graphs = array();
// If there is nothing to do, bail!
if ((!is_array($cmds) || !(count($cmds) > 0))