From f0c3a75ff38dcd208710fa24596c34290faf110e Mon Sep 17 00:00:00 2001 From: Friendika Date: Tue, 30 Aug 2011 23:09:39 -0700 Subject: youtube redirect fixes --- include/bbcode.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'include/bbcode.php') diff --git a/include/bbcode.php b/include/bbcode.php index a3f2971e5..9ee8b7b36 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -133,12 +133,14 @@ function bbcode($Text,$preserve_nl = false) { } else { // Youtube extensions $Text = preg_replace("/\[youtube\]https?:\/\/www.youtube.com\/watch\?v\=(.*?)\[\/youtube\]/",'[youtube]$1[/youtube]',$Text); + $Text = preg_replace("/\[youtube\]https?:\/\/www.youtube.com\/embed\/(.*?)\[\/youtube\]/",'[youtube]$1[/youtube]',$Text); $Text = preg_replace("/\[youtube\]https?:\/\/youtu.be\/(.*?)\[\/youtube\]/",'[youtube]$1[/youtube]',$Text); - $Text = preg_replace("/\[youtube\](.*?)\[\/youtube\]/", '', $Text); + $Text = preg_replace("/\[youtube\]([A-Za-z0-9\-_=]+)(.*?)\[\/youtube\]/", '', $Text); } -// $Text = preg_replace("/\[youtube\](.*?)\[\/youtube\]/", '', $Text); +// $Text = preg_replace("/\[youtube\](.*?)\[\/youtube\]/", '', $Text); + // oembed tag $Text = oembed_bbcode2html($Text); -- cgit v1.2.3