From a219c6432582650f4942cfb3b5c9c94e14551af5 Mon Sep 17 00:00:00 2001 From: Erik Fonnesbeck Date: Wed, 17 Nov 2010 07:43:57 -0700 Subject: Add workaround for referrer check to not be triggered on the previous IP address when redirected by the setup wizard. --- usr/local/www/wizard.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'usr/local') diff --git a/usr/local/www/wizard.php b/usr/local/www/wizard.php index 0c93977..cc9ce72 100755 --- a/usr/local/www/wizard.php +++ b/usr/local/www/wizard.php @@ -894,7 +894,7 @@ if($pkg['step'][$stepid]['javascriptafterformdisplay'] <> "") { */ function fixup_string($string) { - global $config, $myurl, $title; + global $config, $g, $myurl, $title; $newstring = $string; // fixup #1: $myurl -> http[s]://ip_address:port/ switch($config['system']['webgui']['protocol']) { @@ -926,6 +926,8 @@ function fixup_string($string) { else if ($urlhost == get_interface_ip() && is_ipaddr($config['interfaces']['wan']['ipaddr'])) $urlhost = $config['interfaces']['wan']['ipaddr']; } + if($urlhost != $_SERVER['HTTP_HOST']) + file_put_contents("{$g['tmp_path']}/setupwizard_lastreferrer", $proto . "://" . $_SERVER['HTTP_HOST'] . $urlport . $_SERVER['REQUEST_URI']); $myurl = $proto . "://" . $urlhost . $urlport . "/"; if (strstr($newstring, "\$myurl")) -- cgit v1.1