diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2010-11-23 13:54:54 -0500 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2010-11-23 13:54:54 -0500 |
commit | d9114ce0a2d34c0f973adfb70c404e99d15540a0 (patch) | |
tree | 03645de532ee5d803532aa838cec1f9e861b822b | |
parent | 19f101d7d88d9bd4c8edd1ce2c116dffbfd845b8 (diff) | |
download | pfsense-d9114ce0a2d34c0f973adfb70c404e99d15540a0.zip pfsense-d9114ce0a2d34c0f973adfb70c404e99d15540a0.tar.gz |
Ensure returned item is an array.
-rw-r--r-- | etc/inc/util.inc | 14 |
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; } |