From b593c3a9b90bc35e7bfa320acffb63b9b0f3de93 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Tue, 21 Jun 2016 18:18:06 -0700 Subject: 1. provide automatic relocation of important links in items that are imported or synced to clones 2. provide framework for custom curl request bodies using custom/non-standard request methods. This was a real nightmare because curl doesn't actually let you specify a string to send as the request body (except when doing POST). You have to treat it as a file upload using a custom file handler function which provides the actual content in chunks as if it were buffered I/O. 3. item_store and item_store_update now return the item that was stored --- include/items.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'include/items.php') diff --git a/include/items.php b/include/items.php index a844cd1f6..84683273d 100755 --- a/include/items.php +++ b/include/items.php @@ -1889,6 +1889,7 @@ function item_store($arr, $allow_exec = false, $deliver = true) { } + $ret['item'] = $arr; call_hooks('post_remote_end',$arr); @@ -2139,6 +2140,15 @@ function item_store_update($arr,$allow_exec = false, $deliver = true) { return $ret; } + // fetch an unescaped complete copy of the stored item + + $r = q("select * from item where id = %d", + intval($orig_post_id) + ); + if($r) + $arr = $r[0]; + + $r = q("delete from term where oid = %d and otype = %d", intval($orig_post_id), intval(TERM_OBJ_POST) @@ -2170,6 +2180,8 @@ function item_store_update($arr,$allow_exec = false, $deliver = true) { $arr['iconfig'] = $meta; } + $ret['item'] = $arr; + call_hooks('post_remote_update_end',$arr); if($deliver) { -- cgit v1.2.3