The function "getAttachedData" has been removed

This commit is contained in:
Michael 2023-03-05 21:22:22 +00:00
parent 27cc346f8a
commit eafe54f2dd
7 changed files with 56 additions and 299 deletions

View file

@ -3330,9 +3330,9 @@ class Diaspora
// Fetch the title from an attached link - if there is one
if (empty($item['title']) && DI::pConfig()->get($owner['uid'], 'system', 'attach_link_title')) {
$page_data = BBCode::getAttachmentData($item['body']);
if (!empty($page_data['type']) && !empty($page_data['title']) && ($page_data['type'] == 'link')) {
$title = $page_data['title'];
$media = Post\Media::getByURIId($item['uri-id'], [Post\Media::HTML]);
if (!empty($media) && !empty($media[0]['name']) && ($media[0]['name'] != $media[0]['url'])) {
$title = $media[0]['name'];
}
}

View file

@ -1211,9 +1211,9 @@ class Feed
}
// Fetch information about the post
$siteinfo = BBCode::getAttachedData($item['body']);
if (isset($siteinfo['title'])) {
return $siteinfo['title'];
$media = Post\Media::getByURIId($item['uri-id'], [Post\Media::HTML]);
if (!empty($media) && !empty($media[0]['name']) && ($media[0]['name'] != $media[0]['url'])) {
return $media[0]['name'];
}
// If no bookmark is found then take the first line