diff --git a/usr/local/captiveportal/index.php b/usr/local/captiveportal/index.php index 0170a7a464..e910779eaa 100755 --- a/usr/local/captiveportal/index.php +++ b/usr/local/captiveportal/index.php @@ -77,12 +77,12 @@ if ($orig_host != $ourhostname) { exit; } -if (preg_match("/redirurl=(.*)/", $orig_request, $matches)) - $redirurl = urldecode($matches[1]); -if ($_POST['redirurl']) - $redirurl = $_POST['redirurl']; if (!empty($config['captiveportal']['redirurl'])) $redirurl = $config['captiveportal']['redirurl']; +else if (preg_match("/redirurl=(.*)/", $orig_request, $matches)) + $redirurl = urldecode($matches[1]); +else if ($_REQUEST['redirurl']) + $redirurl = $_REQUEST['redirurl']; $macfilter = !isset($config['captiveportal']['nomacfilter']); $passthrumac = isset($config['captiveportal']['passthrumacadd']);