diff --git a/include/bbcode.php b/include/bbcode.php
index 1969f8444..492f526c3 100644
--- a/include/bbcode.php
+++ b/include/bbcode.php
@@ -227,6 +227,13 @@ function bb_location($match) {
// not yet implemented
}
+function bbiframe($match) {
+ $a = get_app();
+ if(strpos($match[1],get_app()->get_hostname()))
+ return '' . $match[1] . '';
+ return '';
+}
+
function bb_ShareAttributesSimple($match) {
$attributes = $match[1];
@@ -599,16 +606,16 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true) {
// [img float={left, right}]pathtoimage[/img]
if (strpos($Text,'[/img]') !== false) {
- $Text = preg_replace("/\[img float=left\](.*?)\[\/img\]/ism", '', $Text);
+ $Text = preg_replace("/\[img float=left\](.*?)\[\/img\]/ism", '', $Text);
}
if (strpos($Text,'[/img]') !== false) {
- $Text = preg_replace("/\[img float=right\](.*?)\[\/img\]/ism", '', $Text);
+ $Text = preg_replace("/\[img float=right\](.*?)\[\/img\]/ism", '', $Text);
}
if (strpos($Text,'[/zmg]') !== false) {
- $Text = preg_replace("/\[zmg float=left\](.*?)\[\/zmg\]/ism", '', $Text);
+ $Text = preg_replace("/\[zmg float=left\](.*?)\[\/zmg\]/ism", '', $Text);
}
if (strpos($Text,'[/zmg]') !== false) {
- $Text = preg_replace("/\[zmg float=right\](.*?)\[\/zmg\]/ism", '', $Text);
+ $Text = preg_replace("/\[zmg float=right\](.*?)\[\/zmg\]/ism", '', $Text);
}
// [img=widthxheight]pathtoimage[/img]
@@ -621,16 +628,16 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true) {
// [img=widthxheight float={left, right}]pathtoimage[/img]
if (strpos($Text,'[/img]') !== false) {
- $Text = preg_replace("/\[img\=([0-9]*)x([0-9]*) float=left\](.*?)\[\/img\]/ism", '', $Text);
+ $Text = preg_replace("/\[img\=([0-9]*)x([0-9]*) float=left\](.*?)\[\/img\]/ism", '', $Text);
}
if (strpos($Text,'[/img]') !== false) {
- $Text = preg_replace("/\[img\=([0-9]*)x([0-9]*) float=right\](.*?)\[\/img\]/ism", '', $Text);
+ $Text = preg_replace("/\[img\=([0-9]*)x([0-9]*) float=right\](.*?)\[\/img\]/ism", '', $Text);
}
if (strpos($Text,'[/zmg]') !== false) {
- $Text = preg_replace("/\[zmg\=([0-9]*)x([0-9]*) float=left\](.*?)\[\/zmg\]/ism", '', $Text);
+ $Text = preg_replace("/\[zmg\=([0-9]*)x([0-9]*) float=left\](.*?)\[\/zmg\]/ism", '', $Text);
}
if (strpos($Text,'[/zmg]') !== false) {
- $Text = preg_replace("/\[zmg\=([0-9]*)x([0-9]*) float=right\](.*?)\[\/zmg\]/ism", '', $Text);
+ $Text = preg_replace("/\[zmg\=([0-9]*)x([0-9]*) float=right\](.*?)\[\/zmg\]/ism", '', $Text);
}
// style (sanitized)
@@ -677,7 +684,7 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true) {
if ($tryoembed){
if (strpos($Text,'[/iframe]') !== false) {
- $Text = preg_replace("/\[iframe\](.*?)\[\/iframe\]/ism", '', $Text);
+ $Text = preg_replace_callback("/\[iframe\](.*?)\[\/iframe\]/ism", 'bbiframe', $Text);
}
}
else {