]> git.mxchange.org Git - friendica.git/blobdiff - mod/wall_attach.php
Continued with #3010:
[friendica.git] / mod / wall_attach.php
index 15e3d3f75e2384f8a8030e31d88c58f2280fb3f2..80fc1c6e796e71c11940e7e3f3f10f40e529f7f6 100644 (file)
@@ -12,7 +12,7 @@ function wall_attach_post(&$a) {
                $r = q("SELECT `user`.*, `contact`.`id` FROM `user` LEFT JOIN `contact` on `user`.`uid` = `contact`.`uid`  WHERE `user`.`nickname` = '%s' AND `user`.`blocked` = 0 and `contact`.`self` = 1 LIMIT 1",
                        dbesc($nick)
                );
-               if(! count($r)){
+               if(! dbm::is_result($r)){
                        if ($r_json) {
                                echo json_encode(array('error'=>t('Invalid request.')));
                                killme();
@@ -55,7 +55,7 @@ function wall_attach_post(&$a) {
                                        intval($contact_id),
                                        intval($page_owner_uid)
                                );
-                               if(count($r)) {
+                               if (dbm::is_result($r)) {
                                        $can_post = true;
                                        $visitor = $contact_id;
                                }
@@ -168,7 +168,7 @@ function wall_attach_post(&$a) {
                dbesc($hash)
        );
 
-       if(! count($r)) {
+       if(! dbm::is_result($r)) {
                $msg = t('File upload failed.');
                if ($r_json) {
                        echo json_encode(array('error'=>$msg));