diff options
author | bcyrill <cyrill@bannwart.info> | 2012-12-17 15:29:52 +0100 |
---|---|---|
committer | bcyrill <cyrill@bannwart.info> | 2012-12-17 15:29:52 +0100 |
commit | e7bd2578747b0ed4e6f505d974173a2331056ec7 (patch) | |
tree | a6a9affcf3ca9c113cfcef348f8d626783cedfd4 /etc/inc/captiveportal.inc | |
parent | 905d1e8e527b7cde8d98f6434bfc40d7b5d684f5 (diff) | |
download | pfsense-e7bd2578747b0ed4e6f505d974173a2331056ec7.zip pfsense-e7bd2578747b0ed4e6f505d974173a2331056ec7.tar.gz |
Add square brackets around IPv6 addresses
Diffstat (limited to 'etc/inc/captiveportal.inc')
-rw-r--r-- | etc/inc/captiveportal.inc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/etc/inc/captiveportal.inc b/etc/inc/captiveportal.inc index fd50c07..ce3aa29 100644 --- a/etc/inc/captiveportal.inc +++ b/etc/inc/captiveportal.inc @@ -1588,10 +1588,14 @@ function portal_reply_page($redirurl, $type = null, $message = null, $clientmac } else { $httpport = $cpcfg['listenporthttp'] ? $cpcfg['listenporthttp'] : $cpcfg['zoneid']; $ifip = portal_ip_from_client_ip($clientip); - if (!$ifip) + if (!$ifip) { $ourhostname = $config['system']['hostname'] . ":{$httpport}"; - else - $ourhostname = "{$ifip}:{$httpport}"; + } else { + if (is_ipaddrv6($ifip)) + $ourhostname = "[{$ifip}]:{$httpport}"; + else + $ourhostname = "{$ifip}:{$httpport}"; + } $htmltext = str_replace("\$PORTAL_ACTION\$", "http://{$ourhostname}/", $htmltext); $htmltext = str_replace("#PORTAL_ACTION#", "http://{$ourhostname}/", $htmltext); } |