diff options
author | friendica <info@friendica.com> | 2013-07-28 21:04:03 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2013-07-28 21:04:03 -0700 |
commit | d002ff668aee672d7a49cd744d6797eb616b9152 (patch) | |
tree | 01044d6e4788ad9867d57d2c475973a43d368961 /include/items.php | |
parent | 10f016841c612c6cef86cff91f45baea74c5d3d6 (diff) | |
download | volse-hubzilla-d002ff668aee672d7a49cd744d6797eb616b9152.tar.gz volse-hubzilla-d002ff668aee672d7a49cd744d6797eb616b9152.tar.bz2 volse-hubzilla-d002ff668aee672d7a49cd744d6797eb616b9152.zip |
encrypt private messages on disk - there are still a couple of places where the text is leaked in the logs during processing.
Diffstat (limited to 'include/items.php')
-rwxr-xr-x | include/items.php | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/include/items.php b/include/items.php index 863fa419b..6b99fc6b1 100755 --- a/include/items.php +++ b/include/items.php @@ -599,6 +599,14 @@ function encode_item($item) { $scope = map_scope($public_scope); $c_scope = map_scope($comment_scope); + if(array_key_exists('item_flags',$item) && ($item['item_flags'] & ITEM_OBSCURED)) { + $key = get_config('system','prvkey'); + if($item['title']) + $item['title'] = aes_unencapsulate(json_decode($item['title'],true),$key); + if($item['body']) + $item['body'] = aes_unencapsulate(json_decode($item['body'],true),$key); + } + if($item['item_restrict'] & ITEM_DELETED) { $x['message_id'] = $item['mid']; $x['created'] = $item['created']; @@ -1553,7 +1561,7 @@ function item_store($arr,$force_parent = false) { if(strlen($allow_cid) || strlen($allow_gid) || strlen($deny_cid) || strlen($deny_gid)) $private = 1; else - $private = $arr['private']; + $private = $arr['item_private']; // Set parent id - and also make sure to inherit the parent's ACL's. @@ -1574,7 +1582,7 @@ function item_store($arr,$force_parent = false) { $arr['allow_gid'] = $allow_gid; $arr['deny_cid'] = $deny_cid; $arr['deny_gid'] = $deny_gid; - $arr['private'] = $private; + $arr['item_private'] = $private; // Store taxonomy |