diff options
-rw-r--r-- | mod/viewsrc.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mod/viewsrc.php b/mod/viewsrc.php index d728f96f5..3a369b613 100644 --- a/mod/viewsrc.php +++ b/mod/viewsrc.php @@ -6,7 +6,7 @@ function viewsrc_content(&$a) { $o = ''; $item_id = ((argc() > 1) ? intval(argv(1)) : 0); - $raw_output = ((argc() > 2 && argv[2] === 'raw') ? true : false); + $json = ((argc() > 2 && argv[2] === 'json') ? true : false); if(! local_user()) { notice( t('Permission denied.') . EOL); @@ -25,7 +25,7 @@ function viewsrc_content(&$a) { ); if($r) - $o = (($raw_output) ? $r[0]['body'] : str_replace("\n",'<br />',$r[0]['body'])); + $o = (($json) ? json_encode($r[0]['body']) : str_replace("\n",'<br />',$r[0]['body'])); } if(is_ajax()) { |