From 5ca88ca10a11a76237aa34d1d93ba3e878567767 Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 31 Jan 2013 23:56:46 -0800 Subject: debugging of file attachment api - somewhat functional but the attachment info structure in the item table needs to be re-done. --- include/attach.php | 13 +++++++------ include/items.php | 4 ++-- 2 files changed, 9 insertions(+), 8 deletions(-) (limited to 'include') diff --git a/include/attach.php b/include/attach.php index 3775d840c..b2c57f36f 100644 --- a/include/attach.php +++ b/include/attach.php @@ -1,5 +1,6 @@ '), - dbesc((array_key_exists('allow_gid',$arr)) ? $arr['allow_gid'] : ''), - dbesc((array_key_exists('deny_cid',$arr)) ? $arr['deny_cid'] : ''), - dbesc((array_key_exists('deny_gid',$arr)) ? $arr['deny_gid'] : '') + dbesc(($arr && array_key_exists('allow_cid',$arr)) ? $arr['allow_cid'] : '<' . $channel['channel_hash'] . '>'), + dbesc(($arr && array_key_exists('allow_gid',$arr)) ? $arr['allow_gid'] : ''), + dbesc(($arr && array_key_exists('deny_cid',$arr)) ? $arr['deny_cid'] : ''), + dbesc(($arr && array_key_exists('deny_gid',$arr)) ? $arr['deny_gid'] : '') ); } diff --git a/include/items.php b/include/items.php index 92e256ea9..6618fe876 100755 --- a/include/items.php +++ b/include/items.php @@ -496,7 +496,7 @@ function get_item_elements($x) { $arr['object'] = activity_sanitise($x['object']); $arr['target'] = activity_sanitise($x['target']); - $arr['attach'] = activity_sanitise($x['attach']); + $arr['attach'] = implode(',',activity_sanitise($x['attach'])); $arr['term'] = decode_tags($x['tags']); $arr['item_private'] = ((array_key_exists('flags',$x) && is_array($x['flags']) && in_array('private',$x['flags'])) ? 1 : 0); @@ -588,7 +588,7 @@ function encode_item($item) { if($item['target']) $x['target'] = json_decode($item['target'],true); if($item['attach']) - $x['attach'] = json_decode($item['attach'],true); + $x['attach'] = explode(',', $item['attach']); if($y = encode_item_flags($item)) $x['flags'] = $y; if($item['term']) -- cgit v1.2.3