diff options
author | redmatrix <redmatrix@redmatrix.me> | 2015-05-06 18:38:30 -0700 |
---|---|---|
committer | redmatrix <redmatrix@redmatrix.me> | 2015-05-06 18:38:30 -0700 |
commit | f17c1f96944cd347296ede2a4d0afaee17b49234 (patch) | |
tree | 77e9adba065c2ecfb6849a91b2ecfa45492b1701 /include/items.php | |
parent | c9ec4f46b6177f88a41d3c3bdc11e06467101721 (diff) | |
download | volse-hubzilla-f17c1f96944cd347296ede2a4d0afaee17b49234.tar.gz volse-hubzilla-f17c1f96944cd347296ede2a4d0afaee17b49234.tar.bz2 volse-hubzilla-f17c1f96944cd347296ede2a4d0afaee17b49234.zip |
no need to obscure the diaspora signature if we're not obscuring the posts
Diffstat (limited to 'include/items.php')
-rwxr-xr-x | include/items.php | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/include/items.php b/include/items.php index 7e8e6b3c2..42ff3cb8b 100755 --- a/include/items.php +++ b/include/items.php @@ -843,7 +843,7 @@ function get_item_elements($x) { $arr['sig'] = (($x['signature']) ? htmlspecialchars($x['signature'], ENT_COMPAT,'UTF-8',false) : ''); - $arr['diaspora_meta'] = (($x['diaspora_signature']) ? json_encode(crypto_encapsulate($x['diaspora_signature'],$key)) : ''); + $arr['diaspora_meta'] = (($x['diaspora_signature']) ? json_encode($x['diaspora_signature']) : ''); $arr['object'] = activity_sanitise($x['object']); $arr['target'] = activity_sanitise($x['target']); @@ -1155,9 +1155,15 @@ function encode_item($item,$mirror = false) { if($item['term']) $x['tags'] = encode_item_terms($item['term']); - if($item['diaspora_meta']) - $x['diaspora_signature'] = crypto_unencapsulate(json_decode($item['diaspora_meta'],true),$key); - + if($item['diaspora_meta']) { + $z = json_decode($item['diaspora_meta'],true); + if($z) { + if(array_key_exists('iv',$z)) + $x['diaspora_signature'] = crypto_unencapsulate($z,$key); + else + $x['diaspora_signature'] = $z; + } + } logger('encode_item: ' . print_r($x,true), LOGGER_DATA); return $x; |