]> git.mxchange.org Git - friendica.git/blobdiff - mod/viewsrc.php
More usage of dbm::is_result($r) instead of count($r):
[friendica.git] / mod / viewsrc.php
index 1203d18fc9dc2597bf2c1d6a64ce59e9a35c318c..1751b856f22e1928590116a4df3f75c17cb47daf 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-if(! function_exists('viewsrc_content')) {
+
 function viewsrc_content(&$a) {
 
        if(! local_user()) {
@@ -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;
 }
-}
+