summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xusr/local/captiveportal/index.php9
1 files changed, 5 insertions, 4 deletions
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;
}
OpenPOWER on IntegriCloud