fixing nits

This commit is contained in:
nobody 2021-04-07 19:11:15 -07:00
parent 52805a5ac6
commit 084438bffd
2 changed files with 7 additions and 6 deletions

View file

@ -2829,13 +2829,18 @@ function tgroup_check($uid, $item) {
}
}
$u = channelx_by_n($uid);
if (! $u) {
return false;
}
// post to group via DM
if ($is_group) {
if (intval($item['item_private']) === 2 && $item['mid'] === $item['parent_mid']) {
return true;
}
if (get_pconfig($uid,'system','post_via_mentions',in_array($role, ['forum','forum_moderated']))) {
if (get_pconfig($uid,'system','post_via_mentions',in_array($role, ['forum','forum_moderated'])) && i_am_mentioned($u,$item)) {
return true;
}
}
@ -2851,10 +2856,6 @@ function tgroup_check($uid, $item) {
return true;
}
$u = channelx_by_n($uid);
if (! $u) {
return false;
}
if (($is_collection) && (perm_is_allowed($uid,$item['author_xchan'],'write_collection') || $item['author_xchan'] === $u['channel_parent'])) {
return true;

View file

@ -371,7 +371,7 @@ function import_remote_xchan_photo($photo, $xchan, $thing = false) {
@file_put_contents('cache/' . $hash, $result['body']);
$info = getimagesize('cache/' . $hash);
@unlink('cache/' . $hash);
if (isset($info) && array_key_exists('mime',$info)) {
if (isset($info) && is_array($info) && array_key_exists('mime',$info)) {
$type = $info['mime'];
}
}