summaryrefslogtreecommitdiffstats
path: root/usr
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2010-08-12 09:03:17 -0400
committerjim-p <jimp@pfsense.org>2010-08-12 09:05:08 -0400
commit3e4f5a3359ebcc46710f37466620d0c0cdfd7293 (patch)
tree91813ab7e7f8ef349dcbd2e60b8bdb000581cc30 /usr
parent8bb30d23a4255fb611ac0c05e11a4d221b7c45a4 (diff)
downloadpfsense-3e4f5a3359ebcc46710f37466620d0c0cdfd7293.zip
pfsense-3e4f5a3359ebcc46710f37466620d0c0cdfd7293.tar.gz
Protect against PHP errors if the interface list is empty
Diffstat (limited to 'usr')
-rwxr-xr-xusr/local/www/services_captiveportal.php13
1 files changed, 8 insertions, 5 deletions
diff --git a/usr/local/www/services_captiveportal.php b/usr/local/www/services_captiveportal.php
index c18e496..5af06ba 100755
--- a/usr/local/www/services_captiveportal.php
+++ b/usr/local/www/services_captiveportal.php
@@ -117,9 +117,10 @@ if ($_POST) {
do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
/* make sure no interfaces are bridged */
- foreach ($pconfig['cinterface'] as $cpbrif)
- if (link_interface_to_bridge($cpbrif))
- $input_errors[] = sprintf(gettext("The captive portal cannot be used on interface %s since it is part of a bridge."), $cpbrif);
+ if (is_array($_POST['cinterface']))
+ foreach ($pconfig['cinterface'] as $cpbrif)
+ if (link_interface_to_bridge($cpbrif))
+ $input_errors[] = sprintf(gettext("The captive portal cannot be used on interface %s since it is part of a bridge."), $cpbrif);
if ($_POST['httpslogin_enable']) {
if (!$_POST['cert'] || !$_POST['key']) {
@@ -169,7 +170,8 @@ if ($_POST) {
}
if (!$input_errors) {
- $config['captiveportal']['interface'] = implode(",", $_POST['cinterface']);
+ if (is_array($_POST['cinterface']))
+ $config['captiveportal']['interface'] = implode(",", $_POST['cinterface']);
$config['captiveportal']['maxproc'] = $_POST['maxproc'];
$config['captiveportal']['maxprocperip'] = $_POST['maxprocperip'] ? $_POST['maxprocperip'] : false;
$config['captiveportal']['timeout'] = $_POST['timeout'];
@@ -222,7 +224,8 @@ if ($_POST) {
$savemsg = get_std_save_message($retval);
- $pconfig['cinterface'] = implode(",", $_POST['cinterface']);
+ if (is_array($_POST['cinterface']))
+ $pconfig['cinterface'] = implode(",", $_POST['cinterface']);
}
}
include("head.inc");
OpenPOWER on IntegriCloud