]> git.mxchange.org Git - friendica.git/blobdiff - mod/viewsrc.php
Merge pull request #3047 from annando/1612-indexlength
[friendica.git] / mod / viewsrc.php
index 1203d18fc9dc2597bf2c1d6a64ce59e9a35c318c..94ed9b5dc247f602feaa6ad21a0df9af43bc73a6 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 
-if(! function_exists('viewsrc_content')) {
+
 function viewsrc_content(&$a) {
 
-       if(! local_user()) {
+       if (! local_user()) {
                notice( t('Access denied.') . EOL);
                return;
        }
@@ -16,7 +16,7 @@ function viewsrc_content(&$a) {
                return;
        }
 
-       $r = q("SELECT `item`.`body` FROM `item`
+       $r = q("SELECT `item`.`body` FROM `item` 
                WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
                and `item`.`moderated` = 0
                AND `item`.`id` = '%s' LIMIT 1",
@@ -24,7 +24,7 @@ function viewsrc_content(&$a) {
                dbesc($item_id)
        );
 
-       if(count($r))
+       if (dbm::is_result($r))
                if(is_ajax()) {
                        echo str_replace("\n",'<br />',$r[0]['body']);
                        killme();
@@ -33,4 +33,4 @@ function viewsrc_content(&$a) {
                }
        return $o;
 }
-}
+