diff options
author | Erik Fonnesbeck <efonnes@gmail.com> | 2010-11-16 18:37:56 -0700 |
---|---|---|
committer | Erik Fonnesbeck <efonnes@gmail.com> | 2010-11-16 18:38:44 -0700 |
commit | f02f0675ccc2bfc59ad969ca0d100f3fd4f4e493 (patch) | |
tree | 559eb5236e501be8c53ff5c6ccbbd89c014338ea /usr | |
parent | aeaa7358823955d3a1f9fbe1ea0a7f03069c0788 (diff) | |
download | pfsense-f02f0675ccc2bfc59ad969ca0d100f3fd4f4e493.zip pfsense-f02f0675ccc2bfc59ad969ca0d100f3fd4f4e493.tar.gz |
Ensure this is an array before entering the foreach loop. Fixes #1012
Diffstat (limited to 'usr')
-rwxr-xr-x | usr/local/www/services_dhcp.php | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/usr/local/www/services_dhcp.php b/usr/local/www/services_dhcp.php index e6c3f68..4ac762a 100755 --- a/usr/local/www/services_dhcp.php +++ b/usr/local/www/services_dhcp.php @@ -305,13 +305,15 @@ if ($_POST) { $dynsubnet_start = ip2ulong($_POST['range_from']); $dynsubnet_end = ip2ulong($_POST['range_to']); - foreach ($a_maps as $map) { - if (empty($map['ipaddr'])) - continue; - if ((ip2ulong($map['ipaddr']) > $dynsubnet_start) && - (ip2ulong($map['ipaddr']) < $dynsubnet_end)) { - $input_errors[] = sprintf(gettext("The DHCP range cannot overlap any static DHCP mappings.")); - break; + if (is_array($a_maps)) { + foreach ($a_maps as $map) { + if (empty($map['ipaddr'])) + continue; + if ((ip2ulong($map['ipaddr']) > $dynsubnet_start) && + (ip2ulong($map['ipaddr']) < $dynsubnet_end)) { + $input_errors[] = sprintf(gettext("The DHCP range cannot overlap any static DHCP mappings.")); + break; + } } } } |