From 69e7c7fecac5d315930c52bfa9fb21954dcf8b5e Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sun, 2 Sep 2018 17:26:05 -0400 Subject: [PATCH] Fix photo attachment display - Remove double image display - Add domain link display to all attachments --- src/Content/Text/BBCode.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Content/Text/BBCode.php b/src/Content/Text/BBCode.php index 41f89e65d..55fc24273 100644 --- a/src/Content/Text/BBCode.php +++ b/src/Content/Text/BBCode.php @@ -578,9 +578,7 @@ class BBCode extends BaseObject $return .= sprintf('
', $data["url"], self::proxyUrl($data["preview"], $simplehtml), $data["title"]); } - if (($data["type"] == "photo") && !empty($data["url"]) && !empty($data["image"])) { - $return .= sprintf('', $data["url"], self::proxyUrl($data["image"], $simplehtml), $data["title"]); - } else { + if (!empty($data['title']) && !empty($data['url'])) { $return .= sprintf('

%s

', $data['url'], $data['title']); } @@ -589,7 +587,8 @@ class BBCode extends BaseObject $bbcode = HTML::toBBCode($data["description"]); $return .= sprintf('
%s
', trim(self::convert($bbcode))); } - if ($data["type"] == "link") { + + if (!empty($data['url'])) { $return .= sprintf('%s', $data['url'], parse_url($data['url'], PHP_URL_HOST)); }