// Check for a repeated message
$shared = Item::getShareArray($item);
if (!empty($shared) && empty($shared['comment'])) {
- $profiledata = [];
- $profiledata['uid'] = -1;
- $profiledata['id'] = -1;
- $profiledata['nickname'] = '';
- $profiledata['name'] = '';
- $profiledata['picdate'] = '';
- $profiledata['photo'] = '';
- $profiledata['url'] = '';
- $profiledata['network'] = '';
+ $profiledata = [
+ 'uid' => -1,
+ 'id' => -1,
+ 'nickname' => '',
+ 'name' => '',
+ 'picdate' => '',
+ 'photo' => '',
+ 'url' => '',
+ 'network' => '',
+ ];
if (!empty($shared['author'])) {
$profiledata['name'] = $shared['author'];
$item = Post::selectFirst(['uid', 'parent-uri-id'], ['uri-id' => $uri_id, 'uid' => $update_uid]);
if (!empty($item)) {
if ($item['uid'] != 0) {
- $a->profile_owner = intval($item['uid']);
+ $a->setProfileOwner($item['uid']);
} else {
- $a->profile_owner = intval($update_uid);
+ $a->setProfileOwner($update_uid);
}
$parent_uri_id = $item['parent-uri-id'];
}
$page_uid = $item['uid'];
}
- $page_contact = DBA::selectFirst('contact', ['id', 'url', 'network', 'name'], ['self' => true, 'uid' => $page_uid]);
- if (DBA::isResult($page_contact)) {
- // "$a->page_contact" is only used in "checkWallToWall" in Post.php.
- // It is used for the wall post feature that has its issues.
- // It can't work with AP or Diaspora since the creator can't sign the post with their private key.
- $a->page_contact = $page_contact;
+ if (!empty($page_uid) && ($page_uid != local_user())) {
$page_user = User::getById($page_uid);
}
- $is_owner = (local_user() && (in_array($page_uid, [local_user(), 0])) ? true : false);
+ $is_owner = local_user() && (in_array($page_uid, [local_user(), 0]));
if (!empty($page_user['hidewall']) && !$is_owner && !$is_remote_contact) {
throw new HTTPException\ForbiddenException(DI::l10n()->t('Access to this profile has been restricted.'));