From 5eeccd519a372229b831387b451022fd72d59cbf Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sat, 2 Nov 2013 10:46:25 +0100 Subject: [PATCH] BBCode: When converting to HTML for the connectors, then videos are now converted in a regular link (there were problems with some vanishing video links) --- include/bbcode.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/include/bbcode.php b/include/bbcode.php index ee251f1f1e..081e4b7c6b 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -633,8 +633,10 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true, $simplehtml = fal $Text = preg_replace_callback("/\[video\](.*?)\[\/video\]/ism", 'tryoembed', $Text); $Text = preg_replace_callback("/\[audio\](.*?)\[\/audio\]/ism", 'tryoembed', $Text); } else { - $Text = preg_replace("/\[video\](.*?)\[\/video\]/", '$1', $Text); - $Text = preg_replace("/\[audio\](.*?)\[\/audio\]/", '$1', $Text); + $Text = preg_replace("/\[video\](.*?)\[\/video\]/", + '$1', $Text); + $Text = preg_replace("/\[audio\](.*?)\[\/audio\]/", + '$1', $Text); } // html5 video and audio @@ -659,8 +661,8 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true, $simplehtml = fal if ($tryoembed) $Text = preg_replace("/\[youtube\]([A-Za-z0-9\-_=]+)(.*?)\[\/youtube\]/ism", '', $Text); else - $Text = preg_replace("/\[youtube\]([A-Za-z0-9\-_=]+)(.*?)\[\/youtube\]/ism", "https://www.youtube.com/watch?v=$1", $Text); - + $Text = preg_replace("/\[youtube\]([A-Za-z0-9\-_=]+)(.*?)\[\/youtube\]/ism", + 'https://www.youtube.com/watch?v=$1', $Text); if ($tryoembed) { $Text = preg_replace_callback("/\[vimeo\](https?:\/\/player.vimeo.com\/video\/[0-9]+).*?\[\/vimeo\]/ism",'tryoembed',$Text); @@ -673,7 +675,8 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true, $simplehtml = fal if ($tryoembed) $Text = preg_replace("/\[vimeo\]([0-9]+)(.*?)\[\/vimeo\]/ism", '', $Text); else - $Text = preg_replace("/\[vimeo\]([0-9]+)(.*?)\[\/vimeo\]/ism", "https://vimeo.com/$1", $Text); + $Text = preg_replace("/\[vimeo\]([0-9]+)(.*?)\[\/vimeo\]/ism", + 'https://vimeo.com/$1', $Text); // $Text = preg_replace("/\[youtube\](.*?)\[\/youtube\]/", '', $Text); -- 2.39.5