diff options
author | redmatrix <redmatrix@redmatrix.me> | 2015-06-21 10:07:58 +1000 |
---|---|---|
committer | redmatrix <redmatrix@redmatrix.me> | 2015-06-21 10:07:58 +1000 |
commit | e1caf774806a2af34b0c4786dcb0c9a40d76e517 (patch) | |
tree | ead6712734e81f2fe275946bb5f4a68345310501 /include/items.php | |
parent | 9dfb8a3401fcca98ca647d913faa55f8c56fd350 (diff) | |
parent | ec23a94b6d7f6db1e1d34275b8143cbc947db802 (diff) | |
download | volse-hubzilla-e1caf774806a2af34b0c4786dcb0c9a40d76e517.tar.gz volse-hubzilla-e1caf774806a2af34b0c4786dcb0c9a40d76e517.tar.bz2 volse-hubzilla-e1caf774806a2af34b0c4786dcb0c9a40d76e517.zip |
Merge pull request #352 from solstag/store_update_fix
Make item_store_update only affect the data we requested
Diffstat (limited to 'include/items.php')
-rwxr-xr-x | include/items.php | 19 |
1 files changed, 10 insertions, 9 deletions
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 +} |