Commit 143a9b34 authored by Franco Fichtner's avatar Franco Fichtner

inc: url_safe() for #1168

This doesn't do anything in particular, because we don't know
what the input is without parsing it further.  It's not worse
than before in any case.  ;)
parent f39ce32b
...@@ -216,7 +216,7 @@ function session_auth(&$Login_Error) ...@@ -216,7 +216,7 @@ function session_auth(&$Login_Error)
if (!isset($config['system']['webgui']['quietlogin'])) { if (!isset($config['system']['webgui']['quietlogin'])) {
log_error(sprintf("Successful login for user '%s' from: %s", $_POST['usernamefld'], $_SERVER['REMOTE_ADDR'])); log_error(sprintf("Successful login for user '%s' from: %s", $_POST['usernamefld'], $_SERVER['REMOTE_ADDR']));
} }
header("Location: {$_SERVER['REQUEST_URI']}"); header(url_safe("Location: {$_SERVER['REQUEST_URI']}"));
exit; exit;
} else { } else {
/* give the user an error message */ /* give the user an error message */
...@@ -275,7 +275,7 @@ function session_auth(&$Login_Error) ...@@ -275,7 +275,7 @@ function session_auth(&$Login_Error)
$scriptName = $scriptName[$scriptElms-1]; $scriptName = $scriptName[$scriptElms-1];
/* redirect to page the user is on, it'll prompt them to login again */ /* redirect to page the user is on, it'll prompt them to login again */
header("Location: {$scriptName}"); header(url_safe("Location: {$scriptName}"));
exit; exit;
} }
...@@ -306,8 +306,7 @@ if (!isAllowedPage($_SERVER['REQUEST_URI'])) { ...@@ -306,8 +306,7 @@ if (!isAllowedPage($_SERVER['REQUEST_URI'])) {
$username .= '@' . $_SERVER['REMOTE_ADDR']; $username .= '@' . $_SERVER['REMOTE_ADDR'];
} }
log_error("{$username} attempted to access {$_SERVER['REQUEST_URI']} but does not have access to that page. Redirecting to {$page}."); log_error("{$username} attempted to access {$_SERVER['REQUEST_URI']} but does not have access to that page. Redirecting to {$page}.");
header(url_safe("Location: /{$page}"));
header("Location: /{$page}");
exit; exit;
} else { } else {
display_error_form("201", gettext("No page assigned to this user! Click here to logout.")); display_error_form("201", gettext("No page assigned to this user! Click here to logout."));
...@@ -315,7 +314,6 @@ if (!isAllowedPage($_SERVER['REQUEST_URI'])) { ...@@ -315,7 +314,6 @@ if (!isAllowedPage($_SERVER['REQUEST_URI'])) {
} }
} }
/* /*
* determine if the user is allowed access to the requested page * determine if the user is allowed access to the requested page
*/ */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment