From b8d4d7cdc5e89ca5ef41ee69fcc4d74f494db573 Mon Sep 17 00:00:00 2001 From: Erik Fonnesbeck Date: Thu, 18 Nov 2010 00:23:41 -0700 Subject: Handling this properly when the web gui is on an alternate port number. --- usr/local/www/wizard.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'usr/local/www/wizard.php') diff --git a/usr/local/www/wizard.php b/usr/local/www/wizard.php index 485dd17..d52c738 100755 --- a/usr/local/www/wizard.php +++ b/usr/local/www/wizard.php @@ -918,7 +918,9 @@ function fixup_string($string) { $urlport = ""; } } - $urlhost = $_SERVER['HTTP_HOST']; + $http_host = explode(":", $_SERVER['HTTP_HOST']); + $http_host = $http_host[0]; + $urlhost = $http_host; // If finishing the setup wizard, check if accessing on a LAN or WAN address that changed if($title == "Reload in progress") { if (is_ipaddr($urlhost)) { @@ -930,8 +932,8 @@ function fixup_string($string) { } } } - if($urlhost != $_SERVER['HTTP_HOST']) - file_put_contents("{$g['tmp_path']}/setupwizard_lastreferrer", $proto . "://" . $_SERVER['HTTP_HOST'] . $urlport . $_SERVER['REQUEST_URI']); + if($urlhost != $http_host) + file_put_contents("{$g['tmp_path']}/setupwizard_lastreferrer", $proto . "://" . $http_host . $urlport . $_SERVER['REQUEST_URI']); $myurl = $proto . "://" . $urlhost . $urlport . "/"; if (strstr($newstring, "\$myurl")) -- cgit v1.1