mirror of
https://github.com/friendica/friendica
synced 2025-04-26 03:50:12 +00:00
Remove duplicate profile_uid key in App->profile array
This commit is contained in:
parent
f6f4cbab9d
commit
62fec2f190
3 changed files with 31 additions and 30 deletions
|
@ -64,19 +64,19 @@ class Status extends BaseModule
|
|||
|
||||
$hashtags = $_GET['tag'] ?? '';
|
||||
|
||||
if (DI::config()->get('system', 'block_public') && !local_user() && !Session::getRemoteContactID($a->profile['profile_uid'])) {
|
||||
if (DI::config()->get('system', 'block_public') && !local_user() && !Session::getRemoteContactID($a->profile['uid'])) {
|
||||
return Login::form();
|
||||
}
|
||||
|
||||
$o = '';
|
||||
|
||||
if ($a->profile['profile_uid'] == local_user()) {
|
||||
if ($a->profile['uid'] == local_user()) {
|
||||
Nav::setSelected('home');
|
||||
}
|
||||
|
||||
$remote_contact = Session::getRemoteContactID($a->profile['profile_uid']);
|
||||
$is_owner = local_user() == $a->profile['profile_uid'];
|
||||
$last_updated_key = "profile:" . $a->profile['profile_uid'] . ":" . local_user() . ":" . $remote_contact;
|
||||
$remote_contact = Session::getRemoteContactID($a->profile['uid']);
|
||||
$is_owner = local_user() == $a->profile['uid'];
|
||||
$last_updated_key = "profile:" . $a->profile['uid'] . ":" . local_user() . ":" . $remote_contact;
|
||||
|
||||
if (!empty($a->profile['hidewall']) && !$is_owner && !$remote_contact) {
|
||||
notice(DI::l10n()->t('Access to this profile has been restricted.') . EOL);
|
||||
|
@ -85,7 +85,7 @@ class Status extends BaseModule
|
|||
|
||||
$o .= ProfileModel::getTabs($a, 'status', $is_owner, $a->profile['nickname']);
|
||||
|
||||
$o .= Widget::commonFriendsVisitor($a->profile['profile_uid']);
|
||||
$o .= Widget::commonFriendsVisitor($a->profile['uid']);
|
||||
|
||||
$commpage = $a->profile['page-flags'] == User::PAGE_FLAGS_COMMUNITY;
|
||||
$commvisitor = $commpage && $remote_contact;
|
||||
|
@ -94,7 +94,7 @@ class Status extends BaseModule
|
|||
DI::page()['aside'] .= Widget::categories(DI::baseUrl() . '/profile/' . $a->profile['nickname'] . '/status', XML::escape($category));
|
||||
DI::page()['aside'] .= Widget::tagCloud();
|
||||
|
||||
if (Security::canWriteToUserWall($a->profile['profile_uid'])) {
|
||||
if (Security::canWriteToUserWall($a->profile['uid'])) {
|
||||
$x = [
|
||||
'is_owner' => $is_owner,
|
||||
'allow_location' => ($is_owner || $commvisitor) && $a->profile['allow_location'],
|
||||
|
@ -109,14 +109,14 @@ class Status extends BaseModule
|
|||
'acl' => $is_owner ? ACL::getFullSelectorHTML(DI::page(), $a->user, true) : '',
|
||||
'bang' => '',
|
||||
'visitor' => $is_owner || $commvisitor ? 'block' : 'none',
|
||||
'profile_uid' => $a->profile['profile_uid'],
|
||||
'profile_uid' => $a->profile['uid'],
|
||||
];
|
||||
|
||||
$o .= status_editor($a, $x);
|
||||
}
|
||||
|
||||
// Get permissions SQL - if $remote_contact is true, our remote user has been pre-verified and we already have fetched his/her groups
|
||||
$sql_extra = Item::getPermissionsSQLByUserId($a->profile['profile_uid']);
|
||||
$sql_extra = Item::getPermissionsSQLByUserId($a->profile['uid']);
|
||||
$sql_extra2 = '';
|
||||
|
||||
$last_updated_array = Session::get('last_updated', []);
|
||||
|
@ -125,12 +125,12 @@ class Status extends BaseModule
|
|||
|
||||
if (!empty($category)) {
|
||||
$sql_post_table = sprintf("INNER JOIN (SELECT `oid` FROM `term` WHERE `term` = '%s' AND `otype` = %d AND `type` = %d AND `uid` = %d ORDER BY `tid` DESC) AS `term` ON `item`.`id` = `term`.`oid` ",
|
||||
DBA::escape(Strings::protectSprintf($category)), intval(TERM_OBJ_POST), intval(TERM_CATEGORY), intval($a->profile['profile_uid']));
|
||||
DBA::escape(Strings::protectSprintf($category)), intval(TERM_OBJ_POST), intval(TERM_CATEGORY), intval($a->profile['uid']));
|
||||
}
|
||||
|
||||
if (!empty($hashtags)) {
|
||||
$sql_post_table .= sprintf("INNER JOIN (SELECT `oid` FROM `term` WHERE `term` = '%s' AND `otype` = %d AND `type` = %d AND `uid` = %d ORDER BY `tid` DESC) AS `term` ON `item`.`id` = `term`.`oid` ",
|
||||
DBA::escape(Strings::protectSprintf($hashtags)), intval(TERM_OBJ_POST), intval(TERM_HASHTAG), intval($a->profile['profile_uid']));
|
||||
DBA::escape(Strings::protectSprintf($hashtags)), intval(TERM_OBJ_POST), intval(TERM_HASHTAG), intval($a->profile['uid']));
|
||||
}
|
||||
|
||||
if (!empty($datequery)) {
|
||||
|
@ -142,7 +142,7 @@ class Status extends BaseModule
|
|||
|
||||
// Does the profile page belong to a forum?
|
||||
// If not then we can improve the performance with an additional condition
|
||||
$condition = ['uid' => $a->profile['profile_uid'], 'page-flags' => [User::PAGE_FLAGS_COMMUNITY, User::PAGE_FLAGS_PRVGROUP]];
|
||||
$condition = ['uid' => $a->profile['uid'], 'page-flags' => [User::PAGE_FLAGS_COMMUNITY, User::PAGE_FLAGS_PRVGROUP]];
|
||||
if (!DBA::exists('user', $condition)) {
|
||||
$sql_extra3 = sprintf(" AND `thread`.`contact-id` = %d ", intval(intval($a->profile['contact_id'])));
|
||||
} else {
|
||||
|
@ -186,7 +186,7 @@ class Status extends BaseModule
|
|||
$sql_extra2
|
||||
ORDER BY `thread`.`received` DESC
|
||||
$pager_sql",
|
||||
$a->profile['profile_uid']
|
||||
$a->profile['uid']
|
||||
);
|
||||
|
||||
// Set a time stamp for this page. We will make use of it when we
|
||||
|
@ -208,7 +208,7 @@ class Status extends BaseModule
|
|||
|
||||
$items = DBA::toArray($items_stmt);
|
||||
|
||||
$o .= conversation($a, $items, $pager, 'profile', false, false, 'received', $a->profile['profile_uid']);
|
||||
$o .= conversation($a, $items, $pager, 'profile', false, false, 'received', $a->profile['uid']);
|
||||
|
||||
$o .= $pager->renderMinimal(count($items));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue