aboutsummaryrefslogtreecommitdiffstats
path: root/include/items.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-12-07 23:29:26 -0800
committerfriendica <info@friendica.com>2013-12-07 23:29:26 -0800
commitb8454cbd1df76bb96af6a6d65ff40f08f6919dc5 (patch)
treeb83aa98b385d6a9391ae684b04d49189add2e02c /include/items.php
parentd6d6387a7b788165ffb0a46703252271d546bd8a (diff)
downloadvolse-hubzilla-b8454cbd1df76bb96af6a6d65ff40f08f6919dc5.tar.gz
volse-hubzilla-b8454cbd1df76bb96af6a6d65ff40f08f6919dc5.tar.bz2
volse-hubzilla-b8454cbd1df76bb96af6a6d65ff40f08f6919dc5.zip
post_activity_item issues
Diffstat (limited to 'include/items.php')
-rwxr-xr-xinclude/items.php28
1 files changed, 23 insertions, 5 deletions
diff --git a/include/items.php b/include/items.php
index b6a196f4a..4af544de1 100755
--- a/include/items.php
+++ b/include/items.php
@@ -202,11 +202,29 @@ function post_activity_item($arr) {
return $ret;
}
- if(array_key_exists('content_type',$arr) && $arr['content_type'] == 'text/html')
- $arr['body'] = purify_html($arr['body']);
- else
- $arr['body'] = escape_tags($arr['body']);
+ if(! array_key_exists('mimetype',$arr))
+ $arr['mimetype'] = 'text/bbcode';
+
+ if(array_key_exists('item_private',$arr) && $arr['item_private']) {
+
+ $arr['body'] = z_input_filter($arr['uid'],$arr['body'],$arr['mimetype']);
+
+ if($channel) {
+ if($channel['channel_hash'] === $arr['author_xchan']) {
+ $arr['sig'] = base64url_encode(rsa_sign($arr['body'],$channel['channel_prvkey']));
+ $arr['item_flags'] = $arr['item_flags'] | ITEM_VERIFIED;
+ }
+ }
+
+ logger('Encrypting local storage');
+ $key = get_config('system','pubkey');
+ $arr['item_flags'] = $arr['item_flags'] | ITEM_OBSCURED;
+ if($arr['title'])
+ $arr['title'] = json_encode(aes_encapsulate($arr['title'],$key));
+ if($arr['body'])
+ $arr['body'] = json_encode(aes_encapsulate($arr['body'],$key));
+ }
$arr['mid'] = ((x($arr,'mid')) ? $arr['mid'] : item_message_id());
$arr['parent_mid'] = ((x($arr,'parent_mid')) ? $arr['parent_mid'] : $arr['mid']);
@@ -238,7 +256,7 @@ function post_activity_item($arr) {
$post = item_store($arr);
- if($post['result'])
+ if($post['success'])
$post_id = $post['item_id'];
if($post_id) {