diff options
author | smos <seth.mos@dds.nl> | 2011-08-21 13:36:07 +0200 |
---|---|---|
committer | smos <seth.mos@dds.nl> | 2011-08-21 13:36:07 +0200 |
commit | ac0057675a89c7127c95d953c60879db926ae14c (patch) | |
tree | 5c1187165712b7b35fc6c03155547c472829ffbe /usr/local | |
parent | e6f7e0be56b8b2ea643cefb477a6ffe15380cdbb (diff) | |
download | pfsense-ac0057675a89c7127c95d953c60879db926ae14c.zip pfsense-ac0057675a89c7127c95d953c60879db926ae14c.tar.gz |
Fix the redirect URL for IPv6 addresses Ticket #1583
Diffstat (limited to 'usr/local')
-rw-r--r-- | usr/local/www/system_advanced_admin.php | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/usr/local/www/system_advanced_admin.php b/usr/local/www/system_advanced_admin.php index 02614e2..0538b9d 100644 --- a/usr/local/www/system_advanced_admin.php +++ b/usr/local/www/system_advanced_admin.php @@ -195,7 +195,20 @@ if ($_POST) { if ($restart_webgui) { global $_SERVER; - list($host) = explode(":", $_SERVER['HTTP_HOST']); + $http_host_port = explode("]", $_SERVER['HTTP_HOST']); + /* IPv6 address check */ + if(strstr($_SERVER['HTTP_HOST'], "]")) { + if(count($http_host_port) > 1) { + array_pop($http_host_port); + $host = str_replace(array("[", "]"), "", implode(":", $http_host_port)); + $host = "[{$host}]"; + } else { + $host = str_replace(array("[", "]"), "", implode(":", $http_host_port)); + $host = "[{$host}]"; + } + } else { + list($host) = explode(":", $_SERVER['HTTP_HOST']); + } $prot = $config['system']['webgui']['protocol']; $port = $config['system']['webgui']['port']; if ($port) |