diff options
author | jim-p <jimp@pfsense.org> | 2010-06-10 13:50:56 -0400 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2010-06-10 13:50:56 -0400 |
commit | 1ce96d36eec8c11b7f99146d5a81be11bdf5be4d (patch) | |
tree | 8f4d24290e3a11fd21940c4bede08e77558dfa74 /usr/local/www/carp_status.php | |
parent | 85b13495d8215b2c4f6f7eb68d2742ebecf7919c (diff) | |
download | pfsense-1ce96d36eec8c11b7f99146d5a81be11bdf5be4d.zip pfsense-1ce96d36eec8c11b7f99146d5a81be11bdf5be4d.tar.gz |
Check for an array here to prevent against a foreach error showing in the GUI.
Diffstat (limited to 'usr/local/www/carp_status.php')
-rwxr-xr-x | usr/local/www/carp_status.php | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/usr/local/www/carp_status.php b/usr/local/www/carp_status.php index 87f9419..9b49f14 100755 --- a/usr/local/www/carp_status.php +++ b/usr/local/www/carp_status.php @@ -56,9 +56,11 @@ if($_POST['disablecarp'] <> "") { $carp_ints = get_all_carp_interfaces(); mwexec("/sbin/sysctl net.inet.carp.allow=0"); $carp_counter = find_number_of_created_carp_interfaces(); - foreach($carp_ints as $int) { - mwexec("/sbin/ifconfig $int down"); - mwexec("/sbin/ifconfig $int destroy"); + if (is_array($carp_ints)) { + foreach($carp_ints as $int) { + mwexec("/sbin/ifconfig $int down"); + mwexec("/sbin/ifconfig $int destroy"); + } } $savemsg = "{$carp_counter} IPs have been disabled."; } else { |