diff options
author | jim-p <jimp@pfsense.org> | 2013-10-29 08:52:08 -0400 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2013-10-29 09:05:27 -0400 |
commit | 25147efff43f4aa9971e3026a06afe12898d1984 (patch) | |
tree | 434943068515db3f6b08c9ef68cda48258db90d4 | |
parent | 03ccade9e371e64b4911e1f8dd9a9e0234d8f0cd (diff) | |
download | pfsense-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.
-rw-r--r-- | config/mailreport/mail_reports_generate.php | 18 | ||||
-rw-r--r-- | config/mailreport/mailreport.xml | 2 | ||||
-rw-r--r-- | pkg_config.8.xml | 2 | ||||
-rw-r--r-- | pkg_config.8.xml.amd64 | 2 |
4 files changed, 18 insertions, 6 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)) diff --git a/config/mailreport/mailreport.xml b/config/mailreport/mailreport.xml index 000fc675..5a759984 100644 --- a/config/mailreport/mailreport.xml +++ b/config/mailreport/mailreport.xml @@ -37,7 +37,7 @@ ]]> </copyright> <name>mailreport</name> - <version>2.0.5</version> + <version>2.0.6</version> <title>Status: Mail Reports</title> <additional_files_needed> <prefix>/usr/local/bin/</prefix> diff --git a/pkg_config.8.xml b/pkg_config.8.xml index a00fcc8e..9de70955 100644 --- a/pkg_config.8.xml +++ b/pkg_config.8.xml @@ -1719,7 +1719,7 @@ <name>mailreport</name> <descr>Allows you to setup periodic e-mail reports containing command output, log file contents, and RRD graphs.</descr> <category>Network Management</category> - <version>2.0.5</version> + <version>2.0.6</version> <status>Stable</status> <required_version>2.0</required_version> <config_file>http://www.pfsense.com/packages/config/mailreport/mailreport.xml</config_file> diff --git a/pkg_config.8.xml.amd64 b/pkg_config.8.xml.amd64 index e7b20c45..771a95ec 100644 --- a/pkg_config.8.xml.amd64 +++ b/pkg_config.8.xml.amd64 @@ -1706,7 +1706,7 @@ <name>mailreport</name> <descr>Allows you to setup periodic e-mail reports containing command output, log file contents, and RRD graphs.</descr> <category>Network Management</category> - <version>2.0.5</version> + <version>2.0.6</version> <status>Stable</status> <required_version>2.0</required_version> <config_file>http://www.pfsense.com/packages/config/mailreport/mailreport.xml</config_file> |