diff --git a/include/bbcode.php b/include/bbcode.php
index 0d9d34cd7..75aa4fd89 100644
--- a/include/bbcode.php
+++ b/include/bbcode.php
@@ -77,9 +77,9 @@ function bb_attachment($Text, $plaintext = false, $tryoembed = true) {
$oembed = $bookmark[0];
if (($image != "") AND !strstr(strtolower($oembed), "', $url, $image, $title);
+ $text .= sprintf('
', $url, $image, $title);
elseif (($preview != "") AND !strstr(strtolower($oembed), "', $url, $preview, $title);
+ $text .= sprintf('
', $url, $preview, $title);
$text .= $oembed;