+ // Currently deactivated, since it creates side effects on Mastodon and Pleroma.
+ // It will be reactivated, once this cleared.
+ /*
+ $attach_data = BBCode::getAttachmentData($item['body']);
+ if (!empty($attach_data['url'])) {
+ $attachment = ['type' => 'Page',
+ 'mediaType' => 'text/html',
+ 'url' => $attach_data['url']];
+
+ if (!empty($attach_data['title'])) {
+ $attachment['name'] = $attach_data['title'];
+ }
+
+ if (!empty($attach_data['description'])) {
+ $attachment['summary'] = $attach_data['description'];
+ }
+
+ if (!empty($attach_data['image'])) {
+ $imgdata = Images::getInfoFromURLCached($attach_data['image']);
+ if ($imgdata) {
+ $attachment['icon'] = ['type' => 'Image',
+ 'mediaType' => $imgdata['mime'],
+ 'width' => $imgdata[0],
+ 'height' => $imgdata[1],
+ 'url' => $attach_data['image']];
+ }
+ }
+
+ $attachments[] = $attachment;
+ }
+ */