* @throws HTTPException\InternalServerErrorException
* @throws \ImagickException
*/
- public static function performContactSearch($search, $prefix = '')
+ public static function performContactSearch(string $search, string $prefix = ''): string
{
$config = DI::config();
$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);
}
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);
}
* @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'));