X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fmatch.php;h=41346bc89d6a12e3788b616246e4a1c92abc6212;hb=d7c832748289b24741e34bc44e4906fc71a45d84;hp=451821f9f1285a0969ee3ed5841cd5483166d0cd;hpb=1938ec3ebecd71c806d1cddf2400786a649a8c40;p=friendica.git diff --git a/mod/match.php b/mod/match.php index 451821f9f1..41346bc89d 100644 --- a/mod/match.php +++ b/mod/match.php @@ -25,6 +25,9 @@ use Friendica\Util\Proxy as ProxyUtils; * @param App $a App * * @return string + * @throws ImagickException + * @throws \Friendica\Network\HTTPException\InternalServerErrorException + * @throws Exception */ function match_content(App $a) { @@ -63,7 +66,7 @@ function match_content(App $a) $msearch = json_decode($msearch_json); - $start = defaults($_GET, 'start', 0); + $start = $_GET['start'] ?? 0; $entries = []; $paginate = ''; @@ -72,7 +75,7 @@ function match_content(App $a) $profile = $msearch->results[$i]; // Already known contact - if (Contact::getIdForURL($profile->url, local_user(), true)) { + if (!$profile || Contact::getIdForURL($profile->url, local_user(), true)) { continue; } @@ -89,11 +92,11 @@ function match_content(App $a) $entry = [ 'url' => Contact::magicLink($profile->url), - 'itemurl' => defaults($contact_details, 'addr', $profile->url), + 'itemurl' => $contact_details['addr'] ?? $profile->url, 'name' => $profile->name, - 'details' => defaults($contact_details, 'location', ''), - 'tags' => defaults($contact_details, 'keywords', ''), - 'about' => defaults($contact_details, 'about', ''), + 'details' => $contact_details['location'] ?? '', + 'tags' => $contact_details['keywords'] ?? '', + 'about' => $contact_details['about'] ?? '', 'account_type' => Contact::getAccountType($contact_details), 'thumb' => ProxyUtils::proxifyUrl($profile->photo, false, ProxyUtils::SIZE_THUMB), 'conntxt' => L10n::t('Connect'),