]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/BaseSearch.php
The priority is now a class constant
[friendica.git] / src / Module / BaseSearch.php
index 3497ad9b1d945365bee0e9bbc3bf2cfb355d2422..276598131b6411513fef1eb3b1fae9655bf519d1 100644 (file)
@@ -47,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();
 
@@ -64,7 +64,7 @@ class BaseSearch extends BaseModule
                $header = '';
 
                if (strpos($search, '@') === 0) {
-                       $search  = substr($search, 1);
+                       $search  = trim(substr($search, 1));
                        $type    = Search::TYPE_PEOPLE;
                        $header  = DI::l10n()->t('People Search - %s', $search);
 
@@ -74,7 +74,7 @@ class BaseSearch extends BaseModule
                }
 
                if (strpos($search, '!') === 0) {
-                       $search = substr($search, 1);
+                       $search = trim(substr($search, 1));
                        $type   = Search::TYPE_FORUM;
                        $header = DI::l10n()->t('Forum Search - %s', $search);
                }
@@ -113,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'));