]> git.mxchange.org Git - friendica.git/blobdiff - include/ForumManager.php
Issue 3857: There is the possibility of a bad handling of dislikes
[friendica.git] / include / ForumManager.php
index c2a20df29faf069bd0b3fc987b33e3d12b918e7f..8473035affe43faf33440faa3479f22543c77584 100644 (file)
@@ -1,5 +1,8 @@
 <?php
 
+use Friendica\App;
+use Friendica\Core\System;
+
 /**
  * @file include/ForumManager.php
  * @brief ForumManager class with its methods related to forum functionality *
@@ -39,18 +42,18 @@ class ForumManager {
                        $select = '(`forum` OR `prv`)';
                }
 
-               $contacts = q("SELECT `contact`.`id`, `contact`.`url`, `contact`.`name`, `contact`.`micro`, `contact`.`thumb` FROM `contact`
-                               WHERE `network`= 'dfrn' AND $select AND `uid` = %d
+               $contacts = dba::p("SELECT `contact`.`id`, `contact`.`url`, `contact`.`name`, `contact`.`micro`, `contact`.`thumb` FROM `contact`
+                               WHERE `network`= 'dfrn' AND $select AND `uid` = ?
                                AND NOT `blocked` AND NOT `hidden` AND NOT `pending` AND NOT `archive`
                                AND `success_update` > `failure_update`
                                $order ",
-                               intval($uid)
+                               $uid
                );
 
                if (!$contacts)
                        return($forumlist);
 
-               foreach($contacts as $contact) {
+               while ($contact = dba::fetch($contacts)) {
                        $forumlist[] = array(
                                'url'   => $contact['url'],
                                'name'  => $contact['name'],
@@ -59,6 +62,8 @@ class ForumManager {
                                'thumb' => $contact['thumb'],
                        );
                }
+               dba::close($contacts);
+
                return($forumlist);
        }
 
@@ -102,7 +107,7 @@ class ForumManager {
                                        'name' => $contact['name'],
                                        'cid' => $contact['id'],
                                        'selected'      => $selected,
-                                       'micro' => App::remove_baseurl(proxy_url($contact['micro'], false, PROXY_SIZE_MICRO)),
+                                       'micro' => System::removedBaseUrl(proxy_url($contact['micro'], false, PROXY_SIZE_MICRO)),
                                        'id' => ++$id,
                                );
                                $entries[] = $entry;