]> git.mxchange.org Git - friendica.git/blobdiff - src/Protocol/DFRN.php
Merge pull request #9526 from MrPetovan/bug/9525-mastodon-emojis-tag
[friendica.git] / src / Protocol / DFRN.php
index 629962b97bd35f7ebc8c47633d5838dcc42e1ff6..11c4e3a14d3810f98b2478c13582819cf3b5edf3 100644 (file)
@@ -2146,9 +2146,9 @@ class DFRN
        {
                $rel = "";
                $href = "";
-               $type = "";
-               $length = "0";
-               $title = "";
+               $type = null;
+               $length = null;
+               $title = null;
                foreach ($links as $link) {
                        foreach ($link->attributes as $attributes) {
                                switch ($attributes->name) {
@@ -2165,13 +2165,8 @@ class DFRN
                                                $item["plink"] = $href;
                                                break;
                                        case "enclosure":
-                                               if (!empty($item["attach"])) {
-                                                       $item["attach"] .= ",";
-                                               } else {
-                                                       $item["attach"] = "";
-                                               }
-
-                                               $item["attach"] .= Post\Media::getAttachElement($href, $length, $type, $title);
+                                               Post\Media::insert(['uri-id' => $item['uri-id'], 'type' => Post\Media::DOCUMENT,
+                                                       'url' => $href, 'mimetype' => $type, 'size' => $length, 'description' => $title]);
                                                break;
                                }
                        }