]> git.mxchange.org Git - friendica.git/blobdiff - mod/photo.php
Changed $a->get_baseurl() to App::get_baseurl()
[friendica.git] / mod / photo.php
index 0d60282d5ffc19f7fa39d93f9edfb12722ba25dc..9744b9f239b246a595f3b722b7e4e7c5dda13c39 100644 (file)
@@ -3,7 +3,7 @@
 require_once('include/security.php');
 require_once('include/Photo.php');
 
-function photo_init(&$a) {
+function photo_init(App &$a) {
        global $_SERVER;
 
        $prvcachecontrol = false;
@@ -76,7 +76,7 @@ function photo_init(&$a) {
                        intval($resolution),
                        intval($uid)
                );
-               if(count($r)) {
+               if (dbm::is_result($r)) {
                        $data = $r[0]['data'];
                        $mimetype = $r[0]['type'];
                }
@@ -106,7 +106,7 @@ function photo_init(&$a) {
                        dbesc($photo),
                        intval($resolution)
                );
-               if(count($r)) {
+               if (dbm::is_result($r)) {
 
                        $sql_extra = permissions_sql($r[0]['uid']);
 
@@ -117,9 +117,9 @@ function photo_init(&$a) {
                                intval($resolution)
                        );
 
-                       $public = ($r[0]['allow_cid'] == '') AND ($r[0]['allow_gid'] == '') AND ($r[0]['deny_cid']  == '') AND ($r[0]['deny_gid']  == '');
+                       $public = (dbm::is_result($r)) AND ($r[0]['allow_cid'] == '') AND ($r[0]['allow_gid'] == '') AND ($r[0]['deny_cid']  == '') AND ($r[0]['deny_gid']  == '');
 
-                       if(count($r)) {
+                       if (dbm::is_result($r)) {
                                $resolution = $r[0]['scale'];
                                $data = $r[0]['data'];
                                $mimetype = $r[0]['type'];