X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FCore%2FSearch.php;h=6c741821e5a138ea2e063f225e584372bc06c5a3;hb=4724000d06cd47bd5eee97111f2723962007d3dc;hp=fb63f3d0f7d64821a86b78018e11792a8b7de9fa;hpb=befc2af5043a3afde251721c0d27df695db1bb7e;p=friendica.git diff --git a/src/Core/Search.php b/src/Core/Search.php index fb63f3d0f7..6c741821e5 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'])) {