summaryrefslogtreecommitdiffstats
path: root/usr/local
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2013-01-04 10:24:57 +0000
committerErmal <eri@pfsense.org>2013-01-04 10:24:57 +0000
commit237c6ef22f84a61f2c97e88936f66ba4c6b41322 (patch)
tree3fb7061d9c15713e13f2bb94ca94cc125329df76 /usr/local
parent7bd926d5a4074d92bcc35b4df4f8991f0befd9f2 (diff)
downloadpfsense-237c6ef22f84a61f2c97e88936f66ba4c6b41322.zip
pfsense-237c6ef22f84a61f2c97e88936f66ba4c6b41322.tar.gz
Get back to trim() and strip / from left/right but when redirecting properly create the redirurl var
Diffstat (limited to 'usr/local')
-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