diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2005-12-22 18:27:57 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2005-12-22 18:27:57 +0000 |
commit | 8022eaaafc67d39da423393c2ee16be878d509db (patch) | |
tree | f95df14166f5c4ce094f55977004141f9983655f | |
parent | 58b92d4a1f02ce933f6f4159d1d35c3cb1a63534 (diff) | |
download | pfsense-8022eaaafc67d39da423393c2ee16be878d509db.zip pfsense-8022eaaafc67d39da423393c2ee16be878d509db.tar.gz |
Avoid a Warning:Invalid argument supplied for foreach() in
/etc/inc/pfsense-utils.inc on line 177
-rw-r--r-- | etc/inc/pfsense-utils.inc | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc index 019374e..7ad9978 100644 --- a/etc/inc/pfsense-utils.inc +++ b/etc/inc/pfsense-utils.inc @@ -167,17 +167,21 @@ function is_alias_inuse($alias) { if($alias == "") return false; /* loop through firewall rules looking for alias in use */ foreach($config['filter']['rule'] as $rule) { - if($rule['source']['address'] == $alias) - return true; - if($rule['destination']['address'] == $alias) - return true; + if(isset($rule['source'])) + if($rule['source']['address'] == $alias) + return true; + if(isset($rule['destination'])) + if($rule['destination']['address'] == $alias) + return true; } /* loop through nat rules looking for alias in use */ foreach($config['nat']['rule'] as $rule) { - if($rule['source']['address'] == $alias) - return true; - if($rule['destination']['address'] == $alias) - return true; + if(isset($rule['source'])) + if($rule['source']['address'] == $alias) + return true; + if(isset($rule['destination'])) + if($rule['destination']['address'] == $alias) + return true; } return false; } |