]> git.mxchange.org Git - friendica.git/blobdiff - mod/msearch.php
Merge remote-tracking branch 'upstream/develop' into improved-payload
[friendica.git] / mod / msearch.php
index 48476da4f06542a00d3c101202233c4e035d7543..b280db4f1879045d0c21641902426979d37258a9 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2020, Friendica
+ * @copyright Copyright (C) 2010-2021, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -45,7 +45,7 @@ function msearch_post(App $a)
                "SELECT COUNT(*) AS `total`
                        FROM `profile`
                        JOIN `user` ON `user`.`uid` = `profile`.`uid`
-                       WHERE `user`.`hidewall` = 0
+                       WHERE `profile`.`net-publish`
                        AND MATCH(`pub_keywords`) AGAINST (?)",
                $search
        );
@@ -60,7 +60,7 @@ function msearch_post(App $a)
                "SELECT `pub_keywords`, `username`, `nickname`, `user`.`uid`
                        FROM `user`
                        JOIN `profile` ON `user`.`uid` = `profile`.`uid`
-                       WHERE `user`.`hidewall` = 0
+                       WHERE `profile`.`net-publish`
                        AND MATCH(`pub_keywords`) AGAINST (?)
                        LIMIT ?, ?",
                $search,
@@ -68,7 +68,7 @@ function msearch_post(App $a)
                $perpage
        );
 
-       while($search_result = DBA::fetch($search_stmt)) {
+       while ($search_result = DBA::fetch($search_stmt)) {
                $results[] = [
                        'name'  => $search_result['name'],
                        'url'   => DI::baseUrl() . '/profile/' . $search_result['nickname'],
@@ -77,6 +77,8 @@ function msearch_post(App $a)
                ];
        }
 
+       DBA::close($search_stmt);
+
        $output = ['total' => $total, 'items_page' => $perpage, 'page' => $page, 'results' => $results];
 
        echo json_encode($output);