X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fbbcode.php;h=b68a7c5b188ec74c7e181fd9056a2f8e76084fe5;hb=9d4d29ad9eb6302fb02eda0ba5f6bcd128a86f49;hp=acf6979d84544788a5eb8a2292ad2f77912b64ef;hpb=2753e62483bc4b96a98af361259140cd7e2f4aed;p=friendica.git diff --git a/include/bbcode.php b/include/bbcode.php index acf6979d84..b68a7c5b18 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -301,14 +301,12 @@ function bb_onelinecode_cb($match) { } function tryoembed($match){ - //$url = ((count($match)==2)?$match[1]:$match[2]); $url = $match[1]; // Always embed the SSL version $url = str_replace(array("http://www.youtube.com/", "http://player.vimeo.com/"), array("https://www.youtube.com/", "https://player.vimeo.com/"), $url); - //logger("tryoembed: $url"); $o = oembed_fetch_url($url); @@ -318,7 +316,7 @@ function tryoembed($match){ if ($o->type=="error") return $match[0]; $html = oembed_format_object($o); - return $html; //oembed_iframe($html,$o->width,$o->height); + return $html; } @@ -959,14 +957,14 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true, $simplehtml = fal $Text = preg_replace_callback("&\[url=/posts/([^\[\]]*)\](.*)\[\/url\]&Usi", 'bb_DiasporaLinks', $Text); // if the HTML is used to generate plain text, then don't do this search, but replace all URL of that kind to text - if ($simplehtml != 7) { +// if ($simplehtml != 7) { if (!$forplaintext) $Text = preg_replace("/([^\]\='".'"'."]|^)(https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\;\.\=\_\~\#\%\$\!\+\,]+)/ism", '$1$2', $Text); else { $Text = preg_replace("(\[url\]([$URLSearchString]*)\[\/url\])ism"," $1 ",$Text); $Text = preg_replace_callback("&\[url=([^\[\]]*)\]\[img\](.*)\[\/img\]\[\/url\]&Usi", 'bb_RemovePictureLinks', $Text); } - } +// } if ($tryoembed) $Text = preg_replace_callback("/\[url\]([$URLSearchString]*)\[\/url\]/ism",'tryoembed',$Text);