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.  ;)
This commit is contained in:
Franco Fichtner 2016-10-11 08:30:13 +02:00
parent f39ce32b96
commit 143a9b340f

View File

@ -216,7 +216,7 @@ function session_auth(&$Login_Error)
if (!isset($config['system']['webgui']['quietlogin'])) {
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;
} else {
/* give the user an error message */
@ -275,7 +275,7 @@ function session_auth(&$Login_Error)
$scriptName = $scriptName[$scriptElms-1];
/* redirect to page the user is on, it'll prompt them to login again */
header("Location: {$scriptName}");
header(url_safe("Location: {$scriptName}"));
exit;
}
@ -306,8 +306,7 @@ if (!isAllowedPage($_SERVER['REQUEST_URI'])) {
$username .= '@' . $_SERVER['REMOTE_ADDR'];
}
log_error("{$username} attempted to access {$_SERVER['REQUEST_URI']} but does not have access to that page. Redirecting to {$page}.");
header("Location: /{$page}");
header(url_safe("Location: /{$page}"));
exit;
} else {
display_error_form("201", gettext("No page assigned to this user! Click here to logout."));
@ -315,7 +314,6 @@ if (!isAllowedPage($_SERVER['REQUEST_URI'])) {
}
}
/*
* determine if the user is allowed access to the requested page
*/