From db8ebc9f375478bddc0f48d972e3acfbde80685a Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 9 Jan 2014 15:45:17 -0800 Subject: some minor cleanup on plinks for some very subtle permissions issues --- include/items.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'include/items.php') diff --git a/include/items.php b/include/items.php index d5eea1e6f..9a1e5f81b 100755 --- a/include/items.php +++ b/include/items.php @@ -243,6 +243,12 @@ function post_activity_item($arr) { $arr['comment_policy'] = map_scope($channel['channel_w_comment']); + + if ((! $arr['plink']) && ($arr['item_flags'] & ITEM_THREAD_TOP)) { + $arr['plink'] = z_root() . '/channel/' . $channel['channel_address'] . '/?f=&mid=' . $arr['mid']; + } + + // for the benefit of plugins, we will behave as if this is an API call rather than a normal online post $_REQUEST['api_source'] = 1; @@ -1602,14 +1608,10 @@ function item_store($arr,$allow_exec = false) { $arr['llink'] = z_root() . '/display/' . $arr['mid']; - if((! $arr['plink'])) { - if (local_user() && ($arr['item_flags'] & ITEM_THREAD_TOP)) { - $channel = get_app()->get_channel(); - $arr['plink'] = z_root() . '/channel/' . $channel['channel_address'] . '/?mid=' . $arr['mid']; - } else { - $arr['plink'] = $arr['llink']; - } - } + if(! $arr['plink']) + $arr['plink'] = $arr['llink']; + + if($arr['parent_mid'] === $arr['mid']) { $parent_id = 0; -- cgit v1.2.3