mirror of
https://github.com/friendica/friendica
synced 2025-05-20 12:24:11 +02:00
The "[attach]" field is replaced by the "post-media" table
This commit is contained in:
parent
6d9e170502
commit
d383f49f1e
7 changed files with 58 additions and 104 deletions
|
@ -3578,13 +3578,11 @@ class Diaspora
|
|||
$body = "### ".html_entity_decode($title)."\n\n".$body;
|
||||
}
|
||||
|
||||
if ($item["attach"]) {
|
||||
$cnt = preg_match_all('/href=\"(.*?)\"(.*?)title=\"(.*?)\"/ism', $item["attach"], $matches, PREG_SET_ORDER);
|
||||
if ($cnt) {
|
||||
$body .= "\n".DI::l10n()->t("Attachments:")."\n";
|
||||
foreach ($matches as $mtch) {
|
||||
$body .= "[".$mtch[3]."](".$mtch[1].")\n";
|
||||
}
|
||||
$attachments = Post\Media::getByURIId($item['uri-id'], [Post\Media::DOCUMENT, Post\Media::TORRENT, Post\Media::UNKNOWN]);
|
||||
if (!empty($attachments)) {
|
||||
$body .= "\n".DI::l10n()->t("Attachments:")."\n";
|
||||
foreach ($attachments as $attachment) {
|
||||
$body .= "[" . $attachment['description'] . "](" . $attachment['url'] . ")\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue