mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2025-07-07 08:58:49 +00:00
Make "HTTPRequest::fetchUrl" dynamic
This commit is contained in:
parent
fed6e3cde1
commit
40ff1d7fda
7 changed files with 12 additions and 19 deletions
|
@ -85,7 +85,6 @@ 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;
|
||||
|
@ -675,7 +674,7 @@ function twitter_post_hook(App $a, array &$b)
|
|||
continue;
|
||||
}
|
||||
|
||||
$img_str = HTTPRequest::fetchUrl($image['url']);
|
||||
$img_str = DI::httpRequest()->fetchUrl($image['url']);
|
||||
|
||||
$tempfile = tempnam(get_temppath(), 'cache');
|
||||
file_put_contents($tempfile, $img_str);
|
||||
|
@ -1319,7 +1318,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 = HTTPRequest::fetchUrl($final_url, true, 4);
|
||||
$img_str = DI::httpRequest()->fetchUrl($final_url, true, 4);
|
||||
|
||||
$tempfile = tempnam(get_temppath(), 'cache');
|
||||
file_put_contents($tempfile, $img_str);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue