diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2007-03-26 14:57:04 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2007-03-26 14:57:04 +0000 |
commit | a60fd0cb6204afca13882b35ae1e918b58647af7 (patch) | |
tree | 2698e8d07f29eb22abcb997168e817cdc98a8e2c /usr/local/www/firewall_rules_edit.php | |
parent | 329069c97a586743bd091273ba03ae5ef1d2ac38 (diff) | |
download | pfsense-a60fd0cb6204afca13882b35ae1e918b58647af7.zip pfsense-a60fd0cb6204afca13882b35ae1e918b58647af7.tar.gz |
Only foreach() through the object if it is an array.
This should fix the Warning: Invalid argument supplied for foreach() in /usr/local/www/firewall_rules_edit.php on line 729
Diffstat (limited to 'usr/local/www/firewall_rules_edit.php')
-rwxr-xr-x | usr/local/www/firewall_rules_edit.php | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/usr/local/www/firewall_rules_edit.php b/usr/local/www/firewall_rules_edit.php index 5b0e636..35e8d1e 100755 --- a/usr/local/www/firewall_rules_edit.php +++ b/usr/local/www/firewall_rules_edit.php @@ -726,11 +726,12 @@ include("head.inc"); //build list of schedules $schedules = array(); $schedules[] = "none";//leave none to leave rule enabled all the time - foreach ($config['schedules']['schedule'] as $schedule) - { - if ($schedule['name'] <> "") - $schedules[] = $schedule['name']; - } + if(is_array($config['schedules']['schedule'])) { + foreach ($config['schedules']['schedule'] as $schedule) { + if ($schedule['name'] <> "") + $schedules[] = $schedule['name']; + } + } ?> <tr> <td width="22%" valign="top" class="vncell">Schedule</td> |