mirror of
https://github.com/friendica/friendica
synced 2025-05-02 05:04:24 +02:00
Detection of local requests
This commit is contained in:
parent
01abea7c25
commit
2647514603
3 changed files with 36 additions and 13 deletions
|
@ -22,8 +22,8 @@
|
|||
namespace Friendica\Util;
|
||||
|
||||
use Friendica\Core\Logger;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\DI;
|
||||
use Friendica\Model\Photo;
|
||||
|
||||
/**
|
||||
* Image utilities
|
||||
|
@ -184,7 +184,16 @@ class Images
|
|||
return $data;
|
||||
}
|
||||
|
||||
$img_str = DI::httpRequest()->fetch($url, 4);
|
||||
if (Network::isLocalLink($url) && ($data = Photo::getResourceData($url))) {
|
||||
$photo = Photo::getPhoto($data['guid'], $data['scale']);
|
||||
if (!empty($photo)) {
|
||||
$img_str = Photo::getImageDataForPhoto($photo);
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($img_str)) {
|
||||
$img_str = DI::httpRequest()->fetch($url, 4);
|
||||
}
|
||||
|
||||
if (!$img_str) {
|
||||
return [];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue