diff options
author | mrjive <mrjive@mrjive.it> | 2015-01-06 15:13:03 +0100 |
---|---|---|
committer | mrjive <mrjive@mrjive.it> | 2015-01-06 15:13:03 +0100 |
commit | b80c218606994032e76805900cb9b340ea132358 (patch) | |
tree | bf625cf4c59bf521e639018399bf1770d116a6a0 /mod/viewsrc.php | |
parent | aa6d61d3b19cb13c30bf5a1579adefedf0cc9515 (diff) | |
parent | 3185bfe3ca131d471b8fcdc0c94abf1a114486c7 (diff) | |
download | volse-hubzilla-b80c218606994032e76805900cb9b340ea132358.tar.gz volse-hubzilla-b80c218606994032e76805900cb9b340ea132358.tar.bz2 volse-hubzilla-b80c218606994032e76805900cb9b340ea132358.zip |
Merge pull request #1 from friendica/master
test pull request
Diffstat (limited to 'mod/viewsrc.php')
-rw-r--r-- | mod/viewsrc.php | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/mod/viewsrc.php b/mod/viewsrc.php index 0f4df9b9b..982d1c417 100644 --- a/mod/viewsrc.php +++ b/mod/viewsrc.php @@ -5,6 +5,8 @@ function viewsrc_content(&$a) { $o = ''; + $sys = get_sys_channel(); + $item_id = ((argc() > 1) ? intval(argv(1)) : 0); $json = ((argc() > 2 && argv(2) === 'json') ? true : false); @@ -19,13 +21,17 @@ function viewsrc_content(&$a) { } if(local_user() && $item_id) { - $r = q("select body from item where item_restrict = 0 and uid = %d and id = %d limit 1", + $r = q("select item_flags, body from item where item_restrict = 0 and uid in (%d , %d) and id = %d limit 1", intval(local_user()), + intval($sys['channel_id']), intval($item_id) ); - if($r) + if($r) { + if($r[0]['item_flags'] & ITEM_OBSCURED) + $r[0]['body'] = crypto_unencapsulate(json_decode($r[0]['body'],true),get_config('system','prvkey')); $o = (($json) ? json_encode($r[0]['body']) : str_replace("\n",'<br />',$r[0]['body'])); + } } if(is_ajax()) { |