rich content in oembed now replaces the content in attachments
This commit is contained in:
parent
37cd2c45d1
commit
be96b1eaa4
1 changed files with 11 additions and 7 deletions
|
@ -4,7 +4,7 @@ require_once('include/event.php');
|
||||||
|
|
||||||
function bb_attachment($Text, $plaintext = false, $tryoembed = true) {
|
function bb_attachment($Text, $plaintext = false, $tryoembed = true) {
|
||||||
$Text = preg_replace_callback("/(.*?)\[attachment(.*?)\](.*?)\[\/attachment\]/ism",
|
$Text = preg_replace_callback("/(.*?)\[attachment(.*?)\](.*?)\[\/attachment\]/ism",
|
||||||
function ($match) use ($plaintext){
|
function ($match) use ($plaintext, $tryoembed){
|
||||||
|
|
||||||
$attributes = $match[2];
|
$attributes = $match[2];
|
||||||
|
|
||||||
|
@ -83,6 +83,9 @@ function bb_attachment($Text, $plaintext = false, $tryoembed = true) {
|
||||||
else
|
else
|
||||||
$oembed = $bookmark[0];
|
$oembed = $bookmark[0];
|
||||||
|
|
||||||
|
if (strstr(strtolower($oembed), "<iframe "))
|
||||||
|
$text = $oembed;
|
||||||
|
else {
|
||||||
if (($image != "") AND !strstr(strtolower($oembed), "<img "))
|
if (($image != "") AND !strstr(strtolower($oembed), "<img "))
|
||||||
$text .= sprintf('<a href="%s" target="_blank"><img src="%s" alt="" title="%s" class="attachment-image" /></a><br />', $url, $image, $title);
|
$text .= sprintf('<a href="%s" target="_blank"><img src="%s" alt="" title="%s" class="attachment-image" /></a><br />', $url, $image, $title);
|
||||||
elseif (($preview != "") AND !strstr(strtolower($oembed), "<img "))
|
elseif (($preview != "") AND !strstr(strtolower($oembed), "<img "))
|
||||||
|
@ -92,6 +95,7 @@ function bb_attachment($Text, $plaintext = false, $tryoembed = true) {
|
||||||
|
|
||||||
$text .= sprintf('<blockquote>%s</blockquote></span>', trim($match[3]));
|
$text .= sprintf('<blockquote>%s</blockquote></span>', trim($match[3]));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return($match[1].$text);
|
return($match[1].$text);
|
||||||
},$Text);
|
},$Text);
|
||||||
|
|
Loading…
Reference in a new issue