From: Hypolite Petovan Date: Wed, 10 Feb 2021 04:20:28 +0000 (-0500) Subject: Try OEmbed first for [audio] and [video] tags X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=7653bc00dfc8334d833ca6989758bc74fcca9023;p=friendica.git Try OEmbed first for [audio] and [video] tags --- diff --git a/src/Content/Text/BBCode.php b/src/Content/Text/BBCode.php index 66c180052d..29b8d2525f 100644 --- a/src/Content/Text/BBCode.php +++ b/src/Content/Text/BBCode.php @@ -1616,12 +1616,13 @@ class BBCode // html5 video and audio $text = preg_replace("/\[video\](.*?\.(ogg|ogv|oga|ogm|webm|mp4).*?)\[\/video\]/ism", '', $text); - $text = preg_replace("/\[video\](.*?)\[\/video\]/ism", - '$1', $text); - $text = preg_replace("/\[audio\](.*?)\[\/audio\]/ism", '', $text); $text = preg_replace_callback("/\[video\](.*?)\[\/video\]/ism", $try_oembed_callback, $text); $text = preg_replace_callback("/\[audio\](.*?)\[\/audio\]/ism", $try_oembed_callback, $text); + + $text = preg_replace("/\[video\](.*?)\[\/video\]/ism", + '$1', $text); + $text = preg_replace("/\[audio\](.*?)\[\/audio\]/ism", '', $text); } else { $text = preg_replace("/\[video\](.*?)\[\/video\]/ism", '$1', $text);