Make "HTTPRequest::fetchUrl" dynamic

This commit is contained in:
nupplaPhil 2020-03-04 22:20:28 +01:00 committed by Hypolite Petovan
parent 3b4cf87c95
commit 1aa07f87a4
20 changed files with 26 additions and 46 deletions

View file

@ -21,8 +21,6 @@
namespace Friendica\Core;
use Friendica\Network\HTTPRequest;
/**
* Manage compatibility with federated networks
*/
@ -123,7 +121,7 @@ class Protocol
if (preg_match('=https?://(.*)/user/(.*)=ism', $profile_url, $matches)) {
$statusnet_host = $matches[1];
$statusnet_user = $matches[2];
$UserData = HTTPRequest::fetchUrl('http://' . $statusnet_host . '/api/users/show.json?user_id=' . $statusnet_user);
$UserData = DI::httpRequest()->fetchUrl('http://' . $statusnet_host . '/api/users/show.json?user_id=' . $statusnet_user);
$user = json_decode($UserData);
if ($user) {
$matches[2] = $user->screen_name;