]> 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 b02a036ae4e1996dc4a6853892b77b6b4df71724..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
  *
@@ -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);