]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/BaseSearch.php
Merge remote-tracking branch 'upstream/2022.09-rc' into worker-timeout
[friendica.git] / src / Module / BaseSearch.php
index ca5bb761275688fd927a36774f05ddb3ea0b43af..f1c9f451ec1e7947db327fb7746a2b2010c9f1cc 100644 (file)
@@ -30,6 +30,7 @@ use Friendica\Model;
 use Friendica\Network\HTTPException;
 use Friendica\Object\Search\ContactResult;
 use Friendica\Object\Search\ResultList;
+use Friendica\Util\Network;
 
 /**
  * Base class for search modules
@@ -46,7 +47,7 @@ class BaseSearch extends BaseModule
         * @throws HTTPException\InternalServerErrorException
         * @throws \ImagickException
         */
-       public static function performContactSearch($search, $prefix = '')
+       public static function performContactSearch(string $search, string $prefix = ''): string
        {
                $config = DI::config();
 
@@ -68,7 +69,7 @@ class BaseSearch extends BaseModule
                        $header  = DI::l10n()->t('People Search - %s', $search);
 
                        if (strrpos($search, '@') > 0) {
-                               $results = Search::getContactsFromProbe($search);
+                               $results = Search::getContactsFromProbe(Network::convertToIdn($search));
                        }
                }
 
@@ -78,6 +79,8 @@ class BaseSearch extends BaseModule
                        $header = DI::l10n()->t('Forum Search - %s', $search);
                }
 
+               $search = Network::convertToIdn($search);
+
                if (DI::mode()->isMobile()) {
                        $itemsPerPage = DI::pConfig()->get(local_user(), 'system', 'itemspage_mobile_network',
                                DI::config()->get('system', 'itemspage_network_mobile'));
@@ -110,7 +113,7 @@ class BaseSearch extends BaseModule
         * @throws HTTPException\InternalServerErrorException
         * @throws \ImagickException
         */
-       protected static function printResult(ResultList $results, Pager $pager, $header = '')
+       protected static function printResult(ResultList $results, Pager $pager, string $header = ''): string
        {
                if ($results->getTotal() == 0) {
                        notice(DI::l10n()->t('No matches'));