]> git.mxchange.org Git - friendica.git/commitdiff
Modfy links for attachments
authorMichael <heluecht@pirati.ca>
Tue, 6 Jul 2021 08:40:59 +0000 (08:40 +0000)
committerMichael <heluecht@pirati.ca>
Tue, 6 Jul 2021 08:40:59 +0000 (08:40 +0000)
src/Content/Text/BBCode.php

index f9cdfd1f9b13cc39dfef4db04f802cbf56854265..ec56b2c35c6d47dd6309628eb0c5a2fced0f3d15 100644 (file)
@@ -1411,7 +1411,16 @@ class BBCode
                                } elseif (!in_array($simple_html, [self::INTERNAL, self::EXTERNAL, self::CONNECTORS])) {
                                        $text = self::removeAttachment($text, true);
                                } else {
-                                       $text = self::convertAttachment($text, $simple_html, $try_oembed);
+                                       $data = self::getAttachmentData($text);
+                                       if (!empty($data['image'])) {
+                                               $data['image']   = Post\Link::getByLink($uriid, $data['image']);
+                                       }
+       
+                                       if (!empty($data['preview'])) {
+                                               $data['preview'] = Post\Link::getByLink($uriid, $data['preview']);
+                                       }
+
+                                       $text = self::convertAttachment($text, $simple_html, $try_oembed, $data);
                                }
 
                                $nosmile = strpos($text, '[nosmile]') !== false;