Move post/curl/fetchUrl/fetchUrlFull to own class "Network\HTTPRequest"

This commit is contained in:
nupplaPhil 2020-03-04 22:07:04 +01:00 committed by Hypolite Petovan
parent 31bd1a1ba0
commit 9640142a72
18 changed files with 50 additions and 45 deletions

View file

@ -85,6 +85,7 @@ use Friendica\Model\ItemContent;
use Friendica\Model\ItemURI;
use Friendica\Model\Tag;
use Friendica\Model\User;
use Friendica\Network\HTTPRequest;
use Friendica\Protocol\Activity;
use Friendica\Util\ConfigFileLoader;
use Friendica\Util\DateTimeFormat;
@ -674,7 +675,7 @@ function twitter_post_hook(App $a, array &$b)
continue;
}
$img_str = Network::fetchUrl($image['url']);
$img_str = HTTPRequest::fetchUrl($image['url']);
$tempfile = tempnam(get_temppath(), 'cache');
file_put_contents($tempfile, $img_str);
@ -1318,7 +1319,7 @@ function twitter_expand_entities($body, stdClass $status, $picture)
} elseif ($oembed_data->type != 'link') {
$replace = '[url=' . $expanded_url . ']' . $url->display_url . '[/url]';
} else {
$img_str = Network::fetchUrl($final_url, true, 4);
$img_str = HTTPRequest::fetchUrl($final_url, true, 4);
$tempfile = tempnam(get_temppath(), 'cache');
file_put_contents($tempfile, $img_str);