aboutsummaryrefslogtreecommitdiffstats
path: root/include/items.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2015-01-27 20:00:43 -0800
committerfriendica <info@friendica.com>2015-01-27 20:00:43 -0800
commita2cdd1499c968c31ae1b95933231f80be5fc639b (patch)
tree231780d92f46a0f265e79fa478c3b7e7fc84d085 /include/items.php
parent0bfbe6d61d3c6250a162a29d2cdb0ec78ad02f1d (diff)
parent145b30adfc21b7f29d1431ebd1e2e0f4ebd853bf (diff)
downloadvolse-hubzilla-a2cdd1499c968c31ae1b95933231f80be5fc639b.tar.gz
volse-hubzilla-a2cdd1499c968c31ae1b95933231f80be5fc639b.tar.bz2
volse-hubzilla-a2cdd1499c968c31ae1b95933231f80be5fc639b.zip
Merge branch 'master' into tres
Conflicts: include/socgraph.php
Diffstat (limited to 'include/items.php')
-rwxr-xr-xinclude/items.php53
1 files changed, 20 insertions, 33 deletions
diff --git a/include/items.php b/include/items.php
index 21025f76f..916838f3f 100755
--- a/include/items.php
+++ b/include/items.php
@@ -2181,6 +2181,20 @@ function item_store($arr,$allow_exec = false) {
unset($arr['term']);
}
+ if(strlen($allow_cid) || strlen($allow_gid) || strlen($deny_cid) || strlen($deny_gid) || strlen($public_policy))
+ $private = 1;
+ else
+ $private = $arr['item_private'];
+
+ $arr['parent'] = $parent_id;
+ $arr['allow_cid'] = $allow_cid;
+ $arr['allow_gid'] = $allow_gid;
+ $arr['deny_cid'] = $deny_cid;
+ $arr['deny_gid'] = $deny_gid;
+ $arr['public_policy'] = $public_policy;
+ $arr['item_private'] = $private;
+ $arr['comments_closed'] = $comments_closed;
+
logger('item_store: ' . print_r($arr,true), LOGGER_DATA);
dbesc_array($arr);
@@ -2198,7 +2212,6 @@ function item_store($arr,$allow_exec = false) {
intval($arr['uid'])
);
-
if($r && count($r)) {
$current_post = $r[0]['id'];
$arr = $r[0]; // This will gives us a fresh copy of what's now in the DB and undo the db escaping, which really messes up the notifications
@@ -2218,40 +2231,14 @@ function item_store($arr,$allow_exec = false) {
);
}
- if((! $parent_id) || ($arr['parent_mid'] === $arr['mid']))
- $parent_id = $current_post;
-
- if(strlen($allow_cid) || strlen($allow_gid) || strlen($deny_cid) || strlen($deny_gid) || strlen($public_policy))
- $private = 1;
- else
- $private = $arr['item_private'];
+ $arr['id'] = $current_post;
- // Set parent id - and also make sure to inherit the parent's ACL's.
-
- $r = q("UPDATE item SET parent = %d, allow_cid = '%s', allow_gid = '%s',
- deny_cid = '%s', deny_gid = '%s', public_policy = '%s', item_private = %d, comments_closed = '%s'
- WHERE id = %d",
- intval($parent_id),
- dbesc($allow_cid),
- dbesc($allow_gid),
- dbesc($deny_cid),
- dbesc($deny_gid),
- dbesc($public_policy),
- intval($private),
- dbesc($comments_closed),
- intval($current_post)
- );
+ if(! intval($r[0]['parent'])) {
+ $x = q("update item set parent = id where id = %d",
+ intval($r[0]['id'])
+ );
+ }
- // These are probably redundant now that we've queried the just stored post
- $arr['id'] = $current_post;
- $arr['parent'] = $parent_id;
- $arr['allow_cid'] = $allow_cid;
- $arr['allow_gid'] = $allow_gid;
- $arr['deny_cid'] = $deny_cid;
- $arr['deny_gid'] = $deny_gid;
- $arr['public_policy'] = $public_policy;
- $arr['item_private'] = $private;
- $arr['comments_closed'] = $comments_closed;
// Store taxonomy