X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fbbcode.php;h=8545b2ff8253c9b29c9b71d87b8003a383623e3b;hb=1dda70d144bf86c6c83ed6fbbe2c438a7e1aac4a;hp=eb009477cf40834fc059dca1f1e160d88b5f193e;hpb=8ec833f8087b0bba2f167471c430543c271602dc;p=friendica.git diff --git a/include/bbcode.php b/include/bbcode.php index eb009477cf..8545b2ff82 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -311,6 +311,9 @@ function tryoembed($match){ $o = oembed_fetch_url($url); + if (!is_object($o)) + return $match[0]; + if (isset($match[2])) $o->title = $match[2]; @@ -851,9 +854,6 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true, $simplehtml = fal $a = get_app(); - // Remove the abstract element. It is a non visible element. - $Text = remove_abstract($Text); - // Hide all [noparse] contained bbtags by spacefying them // POSSIBLE BUG --> Will the 'preg' functions crash if there's an embedded image? @@ -861,6 +861,8 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true, $simplehtml = fal $Text = preg_replace_callback("/\[nobb\](.*?)\[\/nobb\]/ism", 'bb_spacefy',$Text); $Text = preg_replace_callback("/\[pre\](.*?)\[\/pre\]/ism", 'bb_spacefy',$Text); + // Remove the abstract element. It is a non visible element. + $Text = remove_abstract($Text); // Move all spaces out of the tags $Text = preg_replace("/\[(\w*)\](\s*)/ism", '$2[$1]', $Text);