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)); }