diff --git a/mod/item.php b/mod/item.php index dbe396e90..d075d611a 100644 --- a/mod/item.php +++ b/mod/item.php @@ -158,29 +158,32 @@ function item_post(App $a) { // Now check that valid personal details have been provided if (!can_write_wall($profile_uid) && !$allow_comment) { notice(L10n::t('Permission denied.') . EOL) ; + if (x($_REQUEST, 'return')) { goaway($return_path); } + killme(); } - - // is this an edited post? - + // Init post instance $orig_post = null; - if ($post_id) { + // is this an edited post? + if ($post_id > 0) { $orig_post = Item::selectFirst(Item::ITEM_FIELDLIST, ['id' => $post_id]); } $user = dba::selectFirst('user', [], ['uid' => $profile_uid]); + if (!DBM::is_result($user) && !$parent) { return; } $categories = ''; + $postopts = ''; - if ($orig_post) { + if (!empty($orig_post)) { $str_group_allow = $orig_post['allow_gid']; $str_contact_allow = $orig_post['allow_cid']; $str_group_deny = $orig_post['deny_gid']; diff --git a/src/Model/Item.php b/src/Model/Item.php index d6635407d..0e01ff7b9 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -72,7 +72,7 @@ class Item extends BaseObject 'title', 'content-warning', 'body', 'location', 'coord', 'app', 'rendered-hash', 'rendered-html', 'object-type', 'object', 'target-type', 'target', 'author-id', 'author-link', 'author-name', 'author-avatar', - 'owner-id', 'owner-link', 'owner-name', 'owner-avatar']; + 'owner-id', 'owner-link', 'owner-name', 'owner-avatar', 'emailcc']; // Never reorder or remove entries from this list. Just add new ones at the end, if needed. // The item-activity table only stores the index and needs this array to know the matching activity.