From 1ce96d36eec8c11b7f99146d5a81be11bdf5be4d Mon Sep 17 00:00:00 2001 From: jim-p Date: Thu, 10 Jun 2010 13:50:56 -0400 Subject: Check for an array here to prevent against a foreach error showing in the GUI. --- usr/local/www/carp_status.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'usr/local/www/carp_status.php') 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 { -- cgit v1.1