]> git.mxchange.org Git - friendica.git/blobdiff - include/enotify.php
More usage of dbm::is_result($r) instead of count($r):
[friendica.git] / include / enotify.php
index 99258c64c8761509c452e99ca304e700ecc5f37f..d548ec1ac72bfda6df3d3d85776ca6c639dc3c22 100644 (file)
@@ -411,7 +411,7 @@ function notification($params) {
                        $hash = random_string();
                        $r = q("SELECT `id` FROM `notify` WHERE `hash` = '%s' LIMIT 1",
                                dbesc($hash));
-                       if (count($r))
+                       if (dbm::is_result($r))
                                $dups = true;
                } while($dups == true);
 
@@ -733,7 +733,7 @@ function check_item_notification($itemid, $uid, $defaulttype = "") {
                        intval($item[0]['contact-id']),
                        intval($uid)
                );
-               $send_notification = count($r);
+               $send_notification = dbm::is_result($r);
 
                if (!$send_notification) {
                        $tags = q("SELECT `url` FROM `term` WHERE `otype` = %d AND `oid` = %d AND `type` = %d AND `uid` = %d",
@@ -743,7 +743,7 @@ function check_item_notification($itemid, $uid, $defaulttype = "") {
                                foreach ($tags AS $tag) {
                                        $r = q("SELECT `id` FROM `contact` WHERE `nurl` = '%s' AND `uid` = %d AND `notify_new_posts`",
                                                normalise_link($tag["url"]), intval($uid));
-                                       if (count($r))
+                                       if (dbm::is_result($r))
                                                $send_notification = true;
                                }
                        }