diff options
author | bcyrill <cyrill@bannwart.info> | 2012-12-17 15:28:34 +0100 |
---|---|---|
committer | bcyrill <cyrill@bannwart.info> | 2012-12-17 15:28:34 +0100 |
commit | 905d1e8e527b7cde8d98f6434bfc40d7b5d684f5 (patch) | |
tree | e7ef39fa6abcbf8cd6fa369ae238c28efe045cfa /usr/local | |
parent | 38d41bb041e4df3e39a7399bb3f37b33a9159ce4 (diff) | |
download | pfsense-905d1e8e527b7cde8d98f6434bfc40d7b5d684f5.zip pfsense-905d1e8e527b7cde8d98f6434bfc40d7b5d684f5.tar.gz |
Add square brackets around IPv6 addresses
Diffstat (limited to 'usr/local')
-rwxr-xr-x | usr/local/captiveportal/index.php | 10 |
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) { |