]> git.mxchange.org Git - friendica.git/commitdiff
Fix photo attachment display
authorHypolite Petovan <mrpetovan@gmail.com>
Sun, 2 Sep 2018 21:26:05 +0000 (17:26 -0400)
committerHypolite Petovan <mrpetovan@gmail.com>
Sun, 2 Sep 2018 21:26:05 +0000 (17:26 -0400)
- Remove double image display
- Add domain link display to all attachments

src/Content/Text/BBCode.php

index 41f89e65dc84e8f35518e4e37da6fe4f36303f7c..55fc24273da7954b3ae45701706c3e6fb384be2b 100644 (file)
@@ -578,9 +578,7 @@ class BBCode extends BaseObject
                                        $return .= sprintf('<a href="%s" target="_blank"><img src="%s" alt="" title="%s" class="attachment-preview" /></a><br />', $data["url"], self::proxyUrl($data["preview"], $simplehtml), $data["title"]);
                                }
 
-                               if (($data["type"] == "photo") && !empty($data["url"]) && !empty($data["image"])) {
-                                       $return .= sprintf('<a href="%s" target="_blank"><img src="%s" alt="" title="%s" class="attachment-image" /></a>', $data["url"], self::proxyUrl($data["image"], $simplehtml), $data["title"]);
-                               } else {
+                               if (!empty($data['title']) && !empty($data['url'])) {
                                        $return .= sprintf('<h4><a href="%s">%s</a></h4>', $data['url'], $data['title']);
                                }
 
@@ -589,7 +587,8 @@ class BBCode extends BaseObject
                                        $bbcode = HTML::toBBCode($data["description"]);
                                        $return .= sprintf('<blockquote>%s</blockquote>', trim(self::convert($bbcode)));
                                }
-                               if ($data["type"] == "link") {
+
+                               if (!empty($data['url'])) {
                                        $return .= sprintf('<sup><a href="%s">%s</a></sup>', $data['url'], parse_url($data['url'], PHP_URL_HOST));
                                }