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

* Redirect to viewprofile.php if profile.php hasn't arguments

* Update CHANGELOG.md
This commit is contained in:
Roman Kelesidis 2023-06-29 21:20:56 +07:00 committed by GitHub
parent a3494791b7
commit 690f34d50b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 12 deletions

View File

@ -6,6 +6,7 @@
**Merged pull requests:**
- Release v2.1.5-2023.06 🎉
- Redirect to viewprofile.php if profile.php hasn't arguments [\#202](https://github.com/torrentpier/torrentpier-lts/pull/202) ([belomaxorka](https://github.com/belomaxorka))
- Show smilies in post for guests [\#196](https://github.com/torrentpier/torrentpier-lts/pull/196) ([belomaxorka](https://github.com/belomaxorka))
- Added showing PM counter in page title [\#193](https://github.com/torrentpier/torrentpier-lts/pull/193) ([belomaxorka](https://github.com/belomaxorka))
- Corrected translations [\#183](https://github.com/torrentpier/torrentpier-lts/pull/183) ([belomaxorka](https://github.com/belomaxorka))

View File

@ -8,19 +8,22 @@ $datastore->enqueue(array(
'ranks',
));
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'))
{

View File

@ -9,7 +9,7 @@ require(BB_ROOT . 'common.php');
$user->session_start();
set_die_append_msg();
$mode = request_var('mode', '');
$mode = request_var('mode', 'viewprofile');
switch ($mode)
{