Revision 237c6ef2
Added by Ermal LUÇI over 12 years ago
usr/local/captiveportal/index.php | ||
---|---|---|
46 | 46 |
|
47 | 47 |
$orig_host = $_ENV['HTTP_HOST']; |
48 | 48 |
/* NOTE: IE 8/9 is buggy and that is why this is needed */ |
49 |
$orig_request = rtrim($_REQUEST['redirurl'], " /");
|
|
49 |
$orig_request = trim($_REQUEST['redirurl'], " /"); |
|
50 | 50 |
$clientip = $_SERVER['REMOTE_ADDR']; |
51 | 51 |
|
52 | 52 |
if (!$clientip) { |
... | ... | |
72 | 72 |
it's connected to us. Issue a redirect... */ |
73 | 73 |
|
74 | 74 |
if (isset($config['captiveportal']['httpslogin'])) |
75 |
header("Location: https://{$ourhostname}/index.php?redirurl=" . urlencode("http://{$orig_host}{$orig_request}")); |
|
76 |
else |
|
77 |
header("Location: http://{$ourhostname}/index.php?redirurl=" . urlencode("http://{$orig_host}{$orig_request}")); |
|
75 |
header("Location: https://{$ourhostname}/index.php?redirurl=" . urlencode("http://{$orig_host}/{$orig_request}")); |
|
76 |
else { |
|
77 |
header("Location: http://{$ourhostname}/index.php?redirurl=" . urlencode("http://{$orig_host}/{$orig_request}")); |
|
78 |
} |
|
78 | 79 |
|
79 | 80 |
exit; |
80 | 81 |
} |
Also available in: Unified diff
Get back to trim() and strip / from left/right but when redirecting properly create the redirurl var