aboutsummaryrefslogtreecommitdiffstats
path: root/include/items.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-07-28 21:04:03 -0700
committerfriendica <info@friendica.com>2013-07-28 21:04:03 -0700
commitd002ff668aee672d7a49cd744d6797eb616b9152 (patch)
tree01044d6e4788ad9867d57d2c475973a43d368961 /include/items.php
parent10f016841c612c6cef86cff91f45baea74c5d3d6 (diff)
downloadvolse-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-xinclude/items.php12
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