diff --git a/include/bbcode.php b/include/bbcode.php index 820a307cb6..61b929ec79 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -73,9 +73,13 @@ function bb_attachment($Text, $simplehtml = false, $tryoembed = true) { elseif (($data["preview"] != "") AND !strstr(strtolower($oembed), "
', $data["url"], proxy_url($data["preview"]), $data["title"]); - $text .= $oembed; + if (($data["type"] == "photo") AND ($data["url"] != "") AND ($data["image"] != "")) + $text .= sprintf('', $data["url"], proxy_url($data["image"]), $data["title"]); + else + $text .= $oembed; - $text .= sprintf('
%s
', trim($data["description"])); + if (trim($data["description"]) != "") + $text .= sprintf('
%s
', trim($data["description"])); } } return $data["text"].$text.$data["after"]; diff --git a/include/plaintext.php b/include/plaintext.php index c6e02a5b24..a6738ca93b 100644 --- a/include/plaintext.php +++ b/include/plaintext.php @@ -85,7 +85,7 @@ function get_attachment_data($body) { if ($type == "") return(array()); - if (!in_array($type, array("link", "audio", "video"))) + if (!in_array($type, array("link", "audio", "photo", "video"))) return(array()); if ($type != "")