summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2010-11-23 13:54:54 -0500
committerScott Ullrich <sullrich@pfsense.org>2010-11-23 13:54:54 -0500
commitd9114ce0a2d34c0f973adfb70c404e99d15540a0 (patch)
tree03645de532ee5d803532aa838cec1f9e861b822b
parent19f101d7d88d9bd4c8edd1ce2c116dffbfd845b8 (diff)
downloadpfsense-d9114ce0a2d34c0f973adfb70c404e99d15540a0.zip
pfsense-d9114ce0a2d34c0f973adfb70c404e99d15540a0.tar.gz
Ensure returned item is an array.
-rw-r--r--etc/inc/util.inc14
1 files changed, 8 insertions, 6 deletions
diff --git a/etc/inc/util.inc b/etc/inc/util.inc
index 79805af..0aadc2f 100644
--- a/etc/inc/util.inc
+++ b/etc/inc/util.inc
@@ -649,14 +649,16 @@ function get_configured_ip_addresses() {
require_once("interfaces.inc");
$ip_array = array();
$interfaces = get_configured_interface_list();
- foreach($interfaces as $int) {
- $ipaddr = get_interface_ip($int);
- $ip_array[$int] = $ipaddr;
+ if(is_array($interfaces)) {
+ foreach($interfaces as $int) {
+ $ipaddr = get_interface_ip($int);
+ $ip_array[$int] = $ipaddr;
+ }
}
$interfaces = get_configured_carp_interface_list();
- foreach($interfaces as $int => $ipaddr) {
- $ip_array[$int] = $ipaddr;
- }
+ if(is_array($interfaces))
+ foreach($interfaces as $int => $ipaddr)
+ $ip_array[$int] = $ipaddr;
return $ip_array;
}
OpenPOWER on IntegriCloud