summaryrefslogtreecommitdiffstats
path: root/usr/local/www/carp_status.php
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2010-06-10 13:50:56 -0400
committerjim-p <jimp@pfsense.org>2010-06-10 13:50:56 -0400
commit1ce96d36eec8c11b7f99146d5a81be11bdf5be4d (patch)
tree8f4d24290e3a11fd21940c4bede08e77558dfa74 /usr/local/www/carp_status.php
parent85b13495d8215b2c4f6f7eb68d2742ebecf7919c (diff)
downloadpfsense-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-xusr/local/www/carp_status.php8
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 {
OpenPOWER on IntegriCloud