diff options
-rw-r--r-- | Zotlabs/Lib/Enotify.php | 4 | ||||
-rw-r--r-- | Zotlabs/Lib/IConfig.php | 5 | ||||
-rw-r--r-- | include/items.php | 6 | ||||
-rw-r--r-- | include/text.php | 6 |
4 files changed, 12 insertions, 9 deletions
diff --git a/Zotlabs/Lib/Enotify.php b/Zotlabs/Lib/Enotify.php index 6820091d5..5f4ef62bb 100644 --- a/Zotlabs/Lib/Enotify.php +++ b/Zotlabs/Lib/Enotify.php @@ -95,8 +95,8 @@ class Enotify { if (array_key_exists('verb', $params['item'])) { // localize_item() alters the original item so make a copy first $i = $params['item']; - logger('calling localize'); - localize_item($i); + // logger('calling localize'); + // localize_item($i); $title = $i['title']; $body = $i['body']; $private = (($i['item_private']) || intval($i['item_obscured'])); diff --git a/Zotlabs/Lib/IConfig.php b/Zotlabs/Lib/IConfig.php index cedf038fd..3540c2b24 100644 --- a/Zotlabs/Lib/IConfig.php +++ b/Zotlabs/Lib/IConfig.php @@ -28,12 +28,13 @@ class IConfig { elseif(intval($item)) $iid = $item; - if(! $iid) + if (!$iid) return $default; + if(is_array($item) && array_key_exists('iconfig',$item) && is_array($item['iconfig'])) { foreach($item['iconfig'] as $c) { - if($c['iid'] == $iid && $c['cat'] == $family && $c['k'] == $key) + if (isset($c['iid']) && $c['iid'] == $iid && isset($c['cat']) && $c['cat'] == $family && isset($c['k']) && $c['k'] == $key) return $c['v']; } } diff --git a/include/items.php b/include/items.php index 1f3671c83..5bc20e521 100644 --- a/include/items.php +++ b/include/items.php @@ -456,7 +456,7 @@ function post_activity_item($arr, $allow_code = false, $deliver = true, $channel $ret = array('success' => false); $is_comment = false; - if((($arr['parent']) && $arr['parent'] != $arr['id']) || (($arr['parent_mid']) && $arr['parent_mid'] != $arr['mid'])) + if((isset($arr['parent'], $arr['id']) && intval($arr['parent']) !== intval($arr['id'])) || (isset($arr['parent_mid'], $arr['mid']) && $arr['parent_mid'] !== $arr['mid'])) $is_comment = true; if(! array_key_exists('item_origin',$arr)) @@ -491,7 +491,7 @@ function post_activity_item($arr, $allow_code = false, $deliver = true, $channel $arr['mimetype'] = 'text/bbcode'; - if(! $arr['mid']) { + if(empty($arr['mid'])) { $arr['uuid'] = ((x($arr,'uuid')) ? $arr['uuid'] : new_uuid()); } $arr['mid'] = ((x($arr,'mid')) ? $arr['mid'] : z_root() . '/item/' . $arr['uuid']); @@ -514,7 +514,7 @@ function post_activity_item($arr, $allow_code = false, $deliver = true, $channel $arr['comment_policy'] = map_scope(PermissionLimits::Get($channel['channel_id'],'post_comments')); - if ((! $arr['plink']) && (intval($arr['item_thread_top']))) { + if (empty($arr['plink']) && (intval($arr['item_thread_top']))) { $arr['plink'] = $arr['mid']; } diff --git a/include/text.php b/include/text.php index 8ac6d791f..fec02a74f 100644 --- a/include/text.php +++ b/include/text.php @@ -2652,7 +2652,7 @@ function xchan_query(&$items, $abook = true, $effective_uid = 0) { $arr[] = "'" . dbesc($item['owner_xchan']) . "'"; if($item['author_xchan'] && (! in_array("'" . dbesc($item['author_xchan']) . "'",$arr))) $arr[] = "'" . dbesc($item['author_xchan']) . "'"; - if($item['source_xchan'] && (! in_array("'" . dbesc($item['source_xchan']) . "'",$arr))) + if(!empty($item['source_xchan']) && (! in_array("'" . dbesc($item['source_xchan']) . "'",$arr))) $arr[] = "'" . dbesc($item['source_xchan']) . "'"; } } @@ -2677,7 +2677,9 @@ function xchan_query(&$items, $abook = true, $effective_uid = 0) { for($x = 0; $x < count($items); $x ++) { $items[$x]['owner'] = find_xchan_in_array($items[$x]['owner_xchan'],$chans); $items[$x]['author'] = find_xchan_in_array($items[$x]['author_xchan'],$chans); - $items[$x]['source'] = find_xchan_in_array($items[$x]['source_xchan'],$chans); + if (!empty($items[$x]['source_xchan'])) { + $items[$x]['source'] = find_xchan_in_array($items[$x]['source_xchan'],$chans); + } } } } |