mirror of
https://github.com/friendica/friendica
synced 2025-04-26 00:30:12 +00:00
Images::getInfoFromURL[Cached]() will both return empty arrays on error and
that needs to be reflected here, too.
This commit is contained in:
parent
eb231bc548
commit
b996712ef7
2 changed files with 7 additions and 4 deletions
|
@ -1377,7 +1377,7 @@ class OStatus
|
|||
case 'photo':
|
||||
if (!empty($siteinfo['image'])) {
|
||||
$imgdata = Images::getInfoFromURLCached($siteinfo['image']);
|
||||
if ($imgdata) {
|
||||
if (!empty($imgdata)) {
|
||||
$attributes = [
|
||||
'rel' => 'enclosure',
|
||||
'href' => $siteinfo['image'],
|
||||
|
@ -1388,6 +1388,7 @@ class OStatus
|
|||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 'video':
|
||||
$attributes = [
|
||||
'rel' => 'enclosure',
|
||||
|
@ -1398,13 +1399,15 @@ class OStatus
|
|||
];
|
||||
XML::addElement($doc, $root, 'link', '', $attributes);
|
||||
break;
|
||||
|
||||
default:
|
||||
Logger::warning('Unsupported type', ['type' => $siteinfo['type'], 'url' => $siteinfo['url']]);
|
||||
break;
|
||||
}
|
||||
|
||||
if (!DI::config()->get('system', 'ostatus_not_attach_preview') && ($siteinfo['type'] != 'photo') && isset($siteinfo['image'])) {
|
||||
$imgdata = Images::getInfoFromURLCached($siteinfo['image']);
|
||||
if ($imgdata) {
|
||||
if (!empty($imgdata)) {
|
||||
$attributes = [
|
||||
'rel' => 'enclosure',
|
||||
'href' => $siteinfo['image'],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue