From: Michael Date: Thu, 12 Dec 2019 14:57:31 +0000 (+0000) Subject: Improved RegExp X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=cc38250538ed24893fa7d5b06547ba887d860eb3;p=friendica.git Improved RegExp --- diff --git a/src/Content/Text/BBCode.php b/src/Content/Text/BBCode.php index 6da3e62fae..fcce795810 100644 --- a/src/Content/Text/BBCode.php +++ b/src/Content/Text/BBCode.php @@ -355,7 +355,7 @@ class BBCode extends BaseObject } // Simplify "video" element - $post['text'] = preg_replace("(\[video.*?\s?src\s?=\s?([^\s\]]*).*?\].*?\[\/video\\])ism", "[video]$1[/video]", $post['text']); + $post['text'] = preg_replace('(\[video.*?\ssrc\s?=\s?([^\s\]]+).*?\].*?\[/video\])ism', '[video]$1[/video]', $post['text']); // Now count the number of external media links preg_match_all("(\[vimeo\](.*?)\[\/vimeo\])ism", $post['text'], $links1, PREG_SET_ORDER); @@ -1610,7 +1610,7 @@ class BBCode extends BaseObject //$Text = preg_replace("/\[crypt=(.*?)\](.*?)\[\/crypt\]/ism", '
' . L10n::t('Encrypted content') . '
', $Text); // Simplify "video" element - $text = preg_replace("(\[video.*?\s?src\s?=\s?([^\s\]]*).*?\].*?\[\/video\\])ism", "[video]$1[/video]", $text); + $text = preg_replace('(\[video.*?\ssrc\s?=\s?([^\s\]]+).*?\].*?\[/video\])ism', '[video]$1[/video]', $text); // Try to Oembed if ($try_oembed) {