X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FCore%2FSearch.php;h=ff4abdfacfb4cfcff9e7ba8c9d0696a4ae68539c;hb=13a91e63aa5896014a010d30f4070f475306a397;hp=8138c5763f63d945d5f2589b10240b1023e5eabd;hpb=57336f341d387104c8701b6d98a37974b57925b9;p=friendica.git diff --git a/src/Core/Search.php b/src/Core/Search.php index 8138c5763f..ff4abdfacf 100644 --- a/src/Core/Search.php +++ b/src/Core/Search.php @@ -1,6 +1,6 @@ fetch($searchUrl, 0, 'application/json'); + $resultJson = DI::httpClient()->fetch($searchUrl, 0, 'application/json'); $results = json_decode($resultJson, true); @@ -134,7 +135,7 @@ class Search $profiles = $results['profiles'] ?? []; foreach ($profiles as $profile) { - $profile_url = $profile['url'] ?? ''; + $profile_url = $profile['profile_url'] ?? ''; $contactDetails = Contact::getByURLForUser($profile_url, local_user()); $result = new ContactResult( @@ -227,7 +228,7 @@ class Search $return = Contact::searchByName($search, $mode); } else { $p = $page > 1 ? 'p=' . $page : ''; - $curlResult = DI::httpRequest()->get(self::getGlobalDirectory() . '/search/people?' . $p . '&q=' . urlencode($search), ['accept_content' => 'application/json']); + $curlResult = DI::httpClient()->get(self::getGlobalDirectory() . '/search/people?' . $p . '&q=' . urlencode($search), [HTTPClientOptions::ACCEPT_CONTENT => ['application/json']]); if ($curlResult->isSuccess()) { $searchResult = json_decode($curlResult->getBody(), true); if (!empty($searchResult['profiles'])) {