]> git.mxchange.org Git - friendica.git/blobdiff - mod/noscrape.php
Adjusted implementation to a better one (thanks to Michael Vogel)
[friendica.git] / mod / noscrape.php
index 7af0d9933c4bc26f0faa2535b5e9902880e44f3b..a948bee4f38807530c25610bd007843899f0ce09 100644 (file)
@@ -6,6 +6,7 @@
 use Friendica\App;
 use Friendica\Core\System;
 use Friendica\Database\DBA;
+use Friendica\Model\Contact;
 use Friendica\Model\Profile;
 
 function noscrape_init(App $a)
@@ -30,7 +31,7 @@ function noscrape_init(App $a)
                'guid'     => $a->profile['guid'],
                'key'      => $a->profile['pubkey'],
                'homepage' => System::baseUrl()."/profile/{$which}",
-               'comm'     => ($a->profile['account-type'] == ACCOUNT_TYPE_COMMUNITY),
+               'comm'     => ($a->profile['account-type'] == Contact::ACCOUNT_TYPE_COMMUNITY),
        ];
 
        if (!$a->profile['net-publish'] || $a->profile['hidewall']) {
@@ -61,9 +62,9 @@ function noscrape_init(App $a)
                $r = q("SELECT COUNT(*) AS `total` FROM `contact` WHERE `uid` = %d AND `self` = 0 AND `blocked` = 0 and `pending` = 0 AND `hidden` = 0 AND `archive` = 0
                                AND `network` IN ('%s', '%s', '%s', '')",
                        intval($a->profile['uid']),
-                       dbesc(NETWORK_DFRN),
-                       dbesc(NETWORK_DIASPORA),
-                       dbesc(NETWORK_OSTATUS)
+                       DBA::escape(NETWORK_DFRN),
+                       DBA::escape(NETWORK_DIASPORA),
+                       DBA::escape(NETWORK_OSTATUS)
                );
                if (DBA::isResult($r)) {
                        $json_info["contacts"] = intval($r[0]['total']);