summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2016-05-12 07:48:09 -0300
committerRenato Botelho <renato@netgate.com>2016-05-12 07:52:45 -0300
commit26c7100b4068d97481ff8b905b8a6eb757cd1b6f (patch)
tree77cbdffe6e79ba60071d84d06054279739ce5c79
parent78012791480c8fa7bc4fbbf0d2b7cbbe4de8975a (diff)
downloadpfsense-26c7100b4068d97481ff8b905b8a6eb757cd1b6f.zip
pfsense-26c7100b4068d97481ff8b905b8a6eb757cd1b6f.tar.gz
Fix #6278
$cpzone is always in lowercase, it's used as the array key used in config.xml. Use it in two cases where the $cp['zone'] was being wrongly used: - To find out zoneid - To replace PORTAL_ACTION url
-rw-r--r--src/etc/inc/captiveportal.inc6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/etc/inc/captiveportal.inc b/src/etc/inc/captiveportal.inc
index 9e3d6e2..dfa9e3c 100644
--- a/src/etc/inc/captiveportal.inc
+++ b/src/etc/inc/captiveportal.inc
@@ -1489,7 +1489,7 @@ function captiveportal_opendb() {
if (!is_numericint($cpzoneid)) {
if (is_array($config['captiveportal'])) {
foreach ($config['captiveportal'] as $cpkey => $cp) {
- if ($cpzone == $cp['zone']) {
+ if ($cpzone == $cpkey) {
$cpzoneid = $cp['zoneid'];
}
}
@@ -1956,8 +1956,8 @@ function portal_reply_page($redirurl, $type = null, $message = null, $clientmac
/* substitute other variables */
$ourhostname = portal_hostname_from_client_ip($clientip);
$protocol = (isset($cpcfg['httpslogin'])) ? 'https://' : 'http://';
- $htmltext = str_replace("\$PORTAL_ACTION\$", "{$protocol}{$ourhostname}/index.php?zone={$cpcfg['zone']}", $htmltext);
- $htmltext = str_replace("#PORTAL_ACTION#", "{$protocol}{$ourhostname}/index.php?zone={$cpcfg['zone']}", $htmltext);
+ $htmltext = str_replace("\$PORTAL_ACTION\$", "{$protocol}{$ourhostname}/index.php?zone={$cpzone}", $htmltext);
+ $htmltext = str_replace("#PORTAL_ACTION#", "{$protocol}{$ourhostname}/index.php?zone={$cpzone}", $htmltext);
$htmltext = str_replace("\$PORTAL_ZONE\$", htmlspecialchars($cpzone), $htmltext);
$htmltext = str_replace("\$PORTAL_REDIRURL\$", htmlspecialchars($redirurl), $htmltext);
OpenPOWER on IntegriCloud