aboutsummaryrefslogtreecommitdiffstats
path: root/include/items.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-01-09 15:45:17 -0800
committerfriendica <info@friendica.com>2014-01-09 15:45:17 -0800
commitdb8ebc9f375478bddc0f48d972e3acfbde80685a (patch)
tree62063483f438fbab8e399e5a5a3550f953f09d13 /include/items.php
parentba0fdde51cbaf12d0bf9f28c6f95421e5fadc695 (diff)
downloadvolse-hubzilla-db8ebc9f375478bddc0f48d972e3acfbde80685a.tar.gz
volse-hubzilla-db8ebc9f375478bddc0f48d972e3acfbde80685a.tar.bz2
volse-hubzilla-db8ebc9f375478bddc0f48d972e3acfbde80685a.zip
some minor cleanup on plinks for some very subtle permissions issues
Diffstat (limited to 'include/items.php')
-rwxr-xr-xinclude/items.php18
1 files changed, 10 insertions, 8 deletions
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;