summaryrefslogtreecommitdiffstats
path: root/usr/local/captiveportal
diff options
context:
space:
mode:
authorbcyrill <cyrill@bannwart.info>2012-12-17 15:28:34 +0100
committerbcyrill <cyrill@bannwart.info>2012-12-17 15:28:34 +0100
commit905d1e8e527b7cde8d98f6434bfc40d7b5d684f5 (patch)
treee7ef39fa6abcbf8cd6fa369ae238c28efe045cfa /usr/local/captiveportal
parent38d41bb041e4df3e39a7399bb3f37b33a9159ce4 (diff)
downloadpfsense-905d1e8e527b7cde8d98f6434bfc40d7b5d684f5.zip
pfsense-905d1e8e527b7cde8d98f6434bfc40d7b5d684f5.tar.gz
Add square brackets around IPv6 addresses
Diffstat (limited to 'usr/local/captiveportal')
-rwxr-xr-xusr/local/captiveportal/index.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/usr/local/captiveportal/index.php b/usr/local/captiveportal/index.php
index 5858174..0b86e84 100755
--- a/usr/local/captiveportal/index.php
+++ b/usr/local/captiveportal/index.php
@@ -69,10 +69,14 @@ if (isset($cpcfg['httpslogin']))
$ourhostname = $cpcfg['httpsname'] . ":" . $listenporthttps;
else {
$ifip = portal_ip_from_client_ip($clientip);
- if (!$ifip)
+ if (!$ifip) {
$ourhostname = "{$config['system']['hostname']}.{$config['system']['domain']}:{$listenporthttp}";
- else
- $ourhostname = "{$ifip}:{$listenporthttp}";
+ } else {
+ if (is_ipaddrv6($ifip))
+ $ourhostname = "[{$ifip}]:{$listenporthttp}";
+ else
+ $ourhostname = "{$ifip}:{$listenporthttp}";
+ }
}
if ($orig_host != $ourhostname) {
OpenPOWER on IntegriCloud