Redirect to viewprofile.php if profile.php hasn't arguments (#821)

This commit is contained in:
Roman Kelesidis 2023-06-29 21:29:50 +07:00 committed by GitHub
commit 695d46e31e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 8 deletions

View file

@ -18,15 +18,16 @@ $datastore->enqueue(array(
'cat_forums',
));
if (empty($_GET[POST_USERS_URL]) || $_GET[POST_USERS_URL] == GUEST_UID) {
bb_die($lang['NO_USER_ID_SPECIFIED']);
}
if (!$profiledata = get_userdata($_GET[POST_USERS_URL])) {
bb_die($lang['NO_USER_ID_SPECIFIED']);
}
if (!$userdata['session_logged_in']) {
redirect(LOGIN_URL . "?redirect={$_SERVER['REQUEST_URI']}");
} else {
if (empty($_GET[POST_USERS_URL])) {
$_GET[POST_USERS_URL] = $userdata['user_id'];
}
}
if (!$profiledata = get_userdata($_GET[POST_USERS_URL])) {
bb_die($lang['NO_USER_ID_SPECIFIED']);
}
if (!$ranks = $datastore->get('ranks')) {