mirror of
https://github.com/friendica/friendica
synced 2025-04-27 02:30:10 +00:00
Improved mimeType detection and setting of the "type" field
This commit is contained in:
parent
0b239f368b
commit
b65f73e348
3 changed files with 104 additions and 38 deletions
|
@ -2684,7 +2684,12 @@ class Item
|
|||
{
|
||||
$leading = '';
|
||||
$trailing = '';
|
||||
foreach (Post\Media::getByURIId($item['uri-id'], [Post\Media::DOCUMENT, Post\Media::TORRENT, Post\Media::UNKNOWN]) as $attachment) {
|
||||
foreach (Post\Media::getByURIId($item['uri-id'], [Post\Media::AUDIO, Post\Media::VIDEO,
|
||||
Post\Media::DOCUMENT, Post\Media::TORRENT, Post\Media::UNKNOWN]) as $attachment) {
|
||||
if (in_array($attachment['type'], [Post\Media::AUDIO, Post\Media::VIDEO]) && strpos($item['body'], $attachment['url'])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$mime = $attachment['mimetype'];
|
||||
|
||||
$author = ['uid' => 0, 'id' => $item['author-id'],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue