Merge pull request #7972 from MrPetovan/bug/notices

Various notices fixes
This commit is contained in:
Philipp 2019-12-19 14:32:28 +01:00 committed by GitHub
commit fb4e59e3d4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 27 additions and 17 deletions

View file

@ -93,7 +93,8 @@ function display_init(App $a)
} }
if ($item["id"] != $item["parent"]) { if ($item["id"] != $item["parent"]) {
$item = Item::selectFirstForUser($item_user, $fields, ['id' => $item["parent"]]); $parent = Item::selectFirstForUser($item_user, $fields, ['id' => $item["parent"]]);
$item = $parent ?: $item;
} }
$profiledata = display_fetchauthor($a, $item); $profiledata = display_fetchauthor($a, $item);
@ -242,8 +243,11 @@ function display_content(App $a, $update = false, $update_uid = 0)
$is_remote_contact = false; $is_remote_contact = false;
$item_uid = local_user(); $item_uid = local_user();
if (isset($item_parent_uri)) { $parent = null;
if (!empty($item_parent_uri)) {
$parent = Item::selectFirst(['uid'], ['uri' => $item_parent_uri, 'wall' => true]); $parent = Item::selectFirst(['uid'], ['uri' => $item_parent_uri, 'wall' => true]);
}
if (DBA::isResult($parent)) { if (DBA::isResult($parent)) {
$a->profile['uid'] = ($a->profile['uid'] ?? 0) ?: $parent['uid']; $a->profile['uid'] = ($a->profile['uid'] ?? 0) ?: $parent['uid'];
$a->profile['profile_uid'] = ($a->profile['profile_uid'] ?? 0) ?: $parent['uid']; $a->profile['profile_uid'] = ($a->profile['profile_uid'] ?? 0) ?: $parent['uid'];
@ -251,7 +255,8 @@ function display_content(App $a, $update = false, $update_uid = 0)
if ($is_remote_contact) { if ($is_remote_contact) {
$item_uid = $parent['uid']; $item_uid = $parent['uid'];
} }
} } else {
$a->profile = ['uid' => intval($item['uid']), 'profile_uid' => intval($item['uid'])];
} }
$page_contact = DBA::selectFirst('contact', [], ['self' => true, 'uid' => $a->profile['uid']]); $page_contact = DBA::selectFirst('contact', [], ['self' => true, 'uid' => $a->profile['uid']]);

View file

@ -85,15 +85,20 @@ class Compose extends BaseModule
$type = 'post'; $type = 'post';
$doesFederate = true; $doesFederate = true;
if ($_REQUEST['contact_allow'] $contact_allow = $_REQUEST['contact_allow'] ?? '';
. $_REQUEST['group_allow'] $group_allow = $_REQUEST['group_allow'] ?? '';
. $_REQUEST['contact_deny'] $contact_deny = $_REQUEST['contact_deny'] ?? '';
. $_REQUEST['group_deny']) $group_deny = $_REQUEST['group_deny'] ?? '';
if ($contact_allow
. $group_allow
. $contact_deny
. $group_deny)
{ {
$contact_allow_list = $_REQUEST['contact_allow'] ? explode(',', $_REQUEST['contact_allow']) : []; $contact_allow_list = $contact_allow ? explode(',', $contact_allow) : [];
$group_allow_list = $_REQUEST['group_allow'] ? explode(',', $_REQUEST['group_allow']) : []; $group_allow_list = $group_allow ? explode(',', $group_allow) : [];
$contact_deny_list = $_REQUEST['contact_deny'] ? explode(',', $_REQUEST['contact_deny']) : []; $contact_deny_list = $contact_deny ? explode(',', $contact_deny) : [];
$group_deny_list = $_REQUEST['group_deny'] ? explode(',', $_REQUEST['group_deny']) : []; $group_deny_list = $group_deny ? explode(',', $group_deny) : [];
} }
break; break;