From 5203443215689fcec7fae36fcd41698504c5e427 Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Mon, 25 Feb 2013 09:32:11 -0300 Subject: Make sure captiveportal section of config is an array, reported on ticket #2838 --- etc/inc/captiveportal.inc | 10 ++++++---- etc/inc/system.inc | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'etc/inc') diff --git a/etc/inc/captiveportal.inc b/etc/inc/captiveportal.inc index c63e3c9..386a4ce 100644 --- a/etc/inc/captiveportal.inc +++ b/etc/inc/captiveportal.inc @@ -370,10 +370,12 @@ EOD; else { /* Deactivate ipfw(4) if not needed */ $cpactive = false; - foreach ($config['captiveportal'] as $cpkey => $cp) { - if (isset($cp['enable'])) { - $cpactive = true; - break; + if (is_array($config['captiveportal'])) { + foreach ($config['captiveportal'] as $cpkey => $cp) { + if (isset($cp['enable'])) { + $cpactive = true; + break; + } } } if ($cpactive === false) diff --git a/etc/inc/system.inc b/etc/inc/system.inc index 423aa11..3bea41e 100644 --- a/etc/inc/system.inc +++ b/etc/inc/system.inc @@ -1348,7 +1348,7 @@ function system_reboot_cleanup() { mwexec("/usr/local/bin/beep.sh stop"); require_once("captiveportal.inc"); - if (isset($config['captiveportal'])) { + if (is_array($config['captiveportal'])) { foreach ($config['captiveportal'] as $cpzone=>$cp) { captiveportal_radius_stop_all(); captiveportal_send_server_accounting(true); -- cgit v1.1