1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 09:15:55 +00:00

login: only allow relative URLs in return=

This commit is contained in:
Andrew Dolgov
2019-03-03 07:53:42 +03:00
parent cc57ed3775
commit c68ac04020
2 changed files with 10 additions and 2 deletions

View File

@@ -712,8 +712,10 @@ class Handler_Public extends Handler {
user_error("Failed login attempt for $login from {$_SERVER['REMOTE_ADDR']}", E_USER_WARNING);
}
if (clean($_REQUEST['return'])) {
header("Location: " . clean($_REQUEST['return']));
$return = clean($_REQUEST['return']);
if ($return && !is_absolute_url($return)) {
header("Location: " . $return);
} else {
header("Location: " . get_self_url_prefix());
}