summaryrefslogtreecommitdiffstats
path: root/usr
diff options
context:
space:
mode:
authorErik Fonnesbeck <efonnes@gmail.com>2010-11-16 18:37:56 -0700
committerErik Fonnesbeck <efonnes@gmail.com>2010-11-16 18:38:44 -0700
commitf02f0675ccc2bfc59ad969ca0d100f3fd4f4e493 (patch)
tree559eb5236e501be8c53ff5c6ccbbd89c014338ea /usr
parentaeaa7358823955d3a1f9fbe1ea0a7f03069c0788 (diff)
downloadpfsense-f02f0675ccc2bfc59ad969ca0d100f3fd4f4e493.zip
pfsense-f02f0675ccc2bfc59ad969ca0d100f3fd4f4e493.tar.gz
Ensure this is an array before entering the foreach loop. Fixes #1012
Diffstat (limited to 'usr')
-rwxr-xr-xusr/local/www/services_dhcp.php16
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;
+ }
}
}
}
OpenPOWER on IntegriCloud