mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
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
This commit is contained in:
parent
e392cc2bdb
commit
0c388fefae
@ -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);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user