]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/BaseSearch.php
Use central function to fetch the global directory
[friendica.git] / src / Module / BaseSearch.php
index bccfc94de594d9c0b6d42d8a78adf5bc5272203d..ca5bb761275688fd927a36774f05ddb3ea0b43af 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2021, the Friendica project
+ * @copyright Copyright (C) 2010-2022, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -48,7 +48,6 @@ class BaseSearch extends BaseModule
         */
        public static function performContactSearch($search, $prefix = '')
        {
-               $a      = DI::app();
                $config = DI::config();
 
                $type = Search::TYPE_ALL;
@@ -92,7 +91,7 @@ class BaseSearch extends BaseModule
                if ($localSearch && empty($results)) {
                        $pager->setItemsPerPage(80);
                        $results = Search::getContactsFromLocalDirectory($search, $type, $pager->getStart(), $pager->getItemsPerPage());
-               } elseif (strlen($config->get('system', 'directory')) && empty($results)) {
+               } elseif (Search::getGlobalDirectory() && empty($results)) {
                        $results = Search::getContactsFromGlobalDirectory($search, $type, $pager->getPage());
                        $pager->setItemsPerPage($results->getItemsPage());
                }