From 237c6ef22f84a61f2c97e88936f66ba4c6b41322 Mon Sep 17 00:00:00 2001 From: Ermal Date: Fri, 4 Jan 2013 10:24:57 +0000 Subject: Get back to trim() and strip / from left/right but when redirecting properly create the redirurl var --- usr/local/captiveportal/index.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'usr/local') diff --git a/usr/local/captiveportal/index.php b/usr/local/captiveportal/index.php index 77e4d44..2a8b3b1 100755 --- a/usr/local/captiveportal/index.php +++ b/usr/local/captiveportal/index.php @@ -46,7 +46,7 @@ header("Connection: close"); $orig_host = $_ENV['HTTP_HOST']; /* NOTE: IE 8/9 is buggy and that is why this is needed */ -$orig_request = rtrim($_REQUEST['redirurl'], " /"); +$orig_request = trim($_REQUEST['redirurl'], " /"); $clientip = $_SERVER['REMOTE_ADDR']; if (!$clientip) { @@ -72,9 +72,10 @@ if ($orig_host != $ourhostname) { it's connected to us. Issue a redirect... */ if (isset($config['captiveportal']['httpslogin'])) - header("Location: https://{$ourhostname}/index.php?redirurl=" . urlencode("http://{$orig_host}{$orig_request}")); - else - header("Location: http://{$ourhostname}/index.php?redirurl=" . urlencode("http://{$orig_host}{$orig_request}")); + header("Location: https://{$ourhostname}/index.php?redirurl=" . urlencode("http://{$orig_host}/{$orig_request}")); + else { + header("Location: http://{$ourhostname}/index.php?redirurl=" . urlencode("http://{$orig_host}/{$orig_request}")); + } exit; } -- cgit v1.1