aboutsummaryrefslogtreecommitdiffstats
path: root/include/text.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-09-16 22:51:39 -0700
committerfriendica <info@friendica.com>2013-09-16 22:51:39 -0700
commita78b76d3938b6747da97bc729521c58f9491105f (patch)
treed25ca41dd37583ad2dc680501ecf52731e0fe2c2 /include/text.php
parentc6d6c01fb619b37fa47f19966421a6636155180c (diff)
downloadvolse-hubzilla-a78b76d3938b6747da97bc729521c58f9491105f.tar.gz
volse-hubzilla-a78b76d3938b6747da97bc729521c58f9491105f.tar.bz2
volse-hubzilla-a78b76d3938b6747da97bc729521c58f9491105f.zip
more work on viewing obscured api posts
Diffstat (limited to 'include/text.php')
-rwxr-xr-xinclude/text.php19
1 files changed, 12 insertions, 7 deletions
diff --git a/include/text.php b/include/text.php
index ac82e4429..e1f0a4e00 100755
--- a/include/text.php
+++ b/include/text.php
@@ -1004,6 +1004,17 @@ function link_compare($a,$b) {
// If attach is true, also add icons for item attachments
+function unobscure(&$item) {
+ 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_plus($item['title']),$key);
+ if($item['body'])
+ $item['body'] = aes_unencapsulate(json_decode_plus($item['body']),$key);
+ }
+
+}
+
function prepare_body(&$item,$attach = false) {
@@ -1013,13 +1024,7 @@ function prepare_body(&$item,$attach = false) {
call_hooks('prepare_body_init', $item);
- 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_plus($item['title']),$key);
- if($item['body'])
- $item['body'] = aes_unencapsulate(json_decode_plus($item['body']),$key);
- }
+ unobscure($item);
$s = prepare_text($item['body'],$item['mimetype']);