Make item_store_update only affect the data we requested
This commit is contained in:
parent
25e134dd9c
commit
ec23a94b6d
@ -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['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['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['title'] = ((array_key_exists('title',$arr)) ? trim($arr['title']) : $orig[0]['title']);
|
||||||
$arr['body'] = ((array_key_exists('body',$arr) && strlen($arr['body'])) ? trim($arr['body']) : '');
|
$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['attach'] = ((x($arr,'attach')) ? notags(trim($arr['attach'])) : $orig[0]['attach']);
|
||||||
$arr['app'] = ((x($arr,'app')) ? notags(trim($arr['app'])) : $orig[0]['app']);
|
$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;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
$r = q("delete from term where oid = %d and otype = %d",
|
if(is_array($terms)) {
|
||||||
intval($orig_post_id),
|
$r = q("delete from term where oid = %d and otype = %d",
|
||||||
intval(TERM_OBJ_POST)
|
intval($orig_post_id),
|
||||||
);
|
intval(TERM_OBJ_POST)
|
||||||
|
);
|
||||||
if(($terms) && (is_array($terms))) {
|
|
||||||
foreach($terms as $t) {
|
foreach($terms as $t) {
|
||||||
q("insert into term (uid,oid,otype,type,term,url)
|
q("insert into term (uid,oid,otype,type,term,url)
|
||||||
values(%d,%d,%d,%d,'%s','%s') ",
|
values(%d,%d,%d,%d,'%s','%s') ",
|
||||||
@ -2631,6 +2630,8 @@ function item_store_update($arr,$allow_exec = false) {
|
|||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function store_diaspora_comment_sig($datarray, $channel, $parent_item, $post_id, $walltowall = false) {
|
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
|
// We won't be able to sign Diaspora comments for authenticated visitors
|
||||||
|
Reference in New Issue
Block a user