aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAlexandre Hannud Abdo <abdo@member.fsf.org>2015-06-20 02:21:25 -0300
committerAlexandre Hannud Abdo <abdo@member.fsf.org>2015-06-20 02:21:25 -0300
commitec23a94b6d7f6db1e1d34275b8143cbc947db802 (patch)
tree22acca9c38004fd945bb8c5e9487289588ddbdfa /include
parent25e134dd9cb4768291517678286a197d5a4e79a6 (diff)
downloadvolse-hubzilla-ec23a94b6d7f6db1e1d34275b8143cbc947db802.tar.gz
volse-hubzilla-ec23a94b6d7f6db1e1d34275b8143cbc947db802.tar.bz2
volse-hubzilla-ec23a94b6d7f6db1e1d34275b8143cbc947db802.zip
Make item_store_update only affect the data we requested
Diffstat (limited to 'include')
-rwxr-xr-xinclude/items.php19
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
+}