Move ACCEPT constants to own "enum" class

This commit is contained in:
Philipp 2022-04-02 21:16:21 +02:00
parent aed0b53925
commit 82f8c14633
No known key found for this signature in database
GPG key ID: 24A7501396EB5432
8 changed files with 22 additions and 14 deletions

View file

@ -56,6 +56,7 @@ use Friendica\Model\Item;
use Friendica\Model\Photo;
use Friendica\Model\Post;
use Friendica\Model\User;
use Friendica\Network\HTTPClient\Client\HttpClientAccept;
use Friendica\Protocol\Activity;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\Strings;
@ -1367,7 +1368,7 @@ function statusnet_convertmsg(App $a, $body)
} elseif ($oembed_data->type != "link") {
$body = str_replace($search, "[url=" . $expanded_url . "]" . $expanded_url . "[/url]", $body);
} else {
$img_str = DI::httpClient()->fetch($expanded_url, 4);
$img_str = DI::httpClient()->fetch($expanded_url, HttpClientAccept::DEFAULT, 4);
$tempfile = tempnam(System::getTempPath(), "cache");
file_put_contents($tempfile, $img_str);