* Fixes applied:
- `if (is_array($some_array))` is better code style than `if ($some_array)` as
the `if()` block really needs an array to be found
- same with `if ($some_id)`, maybe `if ($some_id > 0)` is a more proper check
- added missing field 'emailcc' to Item::ITEM_FIELDLIST
Signed-off-by: Roland Häder <roland@mxchange.org>
* Fixes E_NOTICE of missing variable (PHP's lazyness again).
Signed-off-by: Roland Häder <roland@mxchange.org>
* Use !empty() to avoid accessing empty array.
Signed-off-by: Roland Häder <roland@mxchange.org>
// Now check that valid personal details have been provided
if (!can_write_wall($profile_uid) && !$allow_comment) {
notice(L10n::t('Permission denied.') . EOL) ;
// 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);
}
if (x($_REQUEST, 'return')) {
goaway($return_path);
}
-
- // is this an edited post?
-
+ // 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]);
$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 = '';
if (!DBM::is_result($user) && !$parent) {
return;
}
$categories = '';
+ 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'];
$str_group_allow = $orig_post['allow_gid'];
$str_contact_allow = $orig_post['allow_cid'];
$str_group_deny = $orig_post['deny_gid'];
'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',
'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.
// 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.