From ec23a94b6d7f6db1e1d34275b8143cbc947db802 Mon Sep 17 00:00:00 2001 From: Alexandre Hannud Abdo Date: Sat, 20 Jun 2015 02:21:25 -0300 Subject: Make item_store_update only affect the data we requested --- include/items.php | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'include/items.php') diff --git a/include/items.php b/include/items.php index 0dc6d6ed6..eb4ad1ead 100755 --- a/include/items.php +++ b/include/items.php @@ -2548,8 +2548,8 @@ function item_store_update($arr,$allow_exec = false) { $arr['deny_gid'] = ((array_key_exists('deny_gid',$arr)) ? trim($arr['deny_gid']) : $orig[0]['deny_gid']); $arr['item_private'] = ((array_key_exists('item_private',$arr)) ? intval($arr['item_private']) : $orig[0]['item_private']); - $arr['title'] = ((array_key_exists('title',$arr) && strlen($arr['title'])) ? trim($arr['title']) : ''); - $arr['body'] = ((array_key_exists('body',$arr) && strlen($arr['body'])) ? trim($arr['body']) : ''); + $arr['title'] = ((array_key_exists('title',$arr)) ? trim($arr['title']) : $orig[0]['title']); + $arr['body'] = ((array_key_exists('body',$arr)) ? trim($arr['body']) : $orig[0]['body']); $arr['attach'] = ((x($arr,'attach')) ? notags(trim($arr['attach'])) : $orig[0]['attach']); $arr['app'] = ((x($arr,'app')) ? notags(trim($arr['app'])) : $orig[0]['app']); @@ -2599,12 +2599,11 @@ function item_store_update($arr,$allow_exec = false) { return $ret; } - $r = q("delete from term where oid = %d and otype = %d", - intval($orig_post_id), - intval(TERM_OBJ_POST) - ); - - if(($terms) && (is_array($terms))) { + if(is_array($terms)) { + $r = q("delete from term where oid = %d and otype = %d", + intval($orig_post_id), + intval(TERM_OBJ_POST) + ); foreach($terms as $t) { q("insert into term (uid,oid,otype,type,term,url) values(%d,%d,%d,%d,'%s','%s') ", @@ -2631,6 +2630,8 @@ function item_store_update($arr,$allow_exec = false) { return $ret; } + + function store_diaspora_comment_sig($datarray, $channel, $parent_item, $post_id, $walltowall = false) { // We won't be able to sign Diaspora comments for authenticated visitors @@ -4981,4 +4982,4 @@ function asencode_person($p) { ); return $ret; -} \ No newline at end of file +} -- cgit v1.2.3