aboutsummaryrefslogtreecommitdiffstats
path: root/include/bbcode.php
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-08-30 23:09:39 -0700
committerFriendika <info@friendika.com>2011-08-30 23:09:39 -0700
commitf0c3a75ff38dcd208710fa24596c34290faf110e (patch)
treedcfe58104b8ccbb0dd7c83ad8199388f99d2383a /include/bbcode.php
parentb11a0efff120508a2059afe372f50144dcc8b977 (diff)
downloadvolse-hubzilla-f0c3a75ff38dcd208710fa24596c34290faf110e.tar.gz
volse-hubzilla-f0c3a75ff38dcd208710fa24596c34290faf110e.tar.bz2
volse-hubzilla-f0c3a75ff38dcd208710fa24596c34290faf110e.zip
youtube redirect fixes
Diffstat (limited to 'include/bbcode.php')
-rw-r--r--include/bbcode.php6
1 files changed, 4 insertions, 2 deletions
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\]/", '<iframe width="425" height="349" src="http://www.youtube.com/embed/$1" frameborder="0" ></iframe>', $Text);
+ $Text = preg_replace("/\[youtube\]([A-Za-z0-9\-_=]+)(.*?)\[\/youtube\]/", '<iframe width="425" height="350" src="http://www.youtube.com/embed/$1" frameborder="0" ></iframe>', $Text);
}
-// $Text = preg_replace("/\[youtube\](.*?)\[\/youtube\]/", '<object width="425" height="350" type="application/x-shockwave-flash" data="http://www.youtube.com/v/$1" ><param name="movie" value="http://www.youtube.com/v/$1"></param><!--[if IE]><embed src="http://www.youtube.com/v/$1" type="application/x-shockwave-flash" width="425" height="350" /><![endif]--></object>', $Text);
+// $Text = preg_replace("/\[youtube\](.*?)\[\/youtube\]/", '<object width="425" height="350" type="application/x-shockwave-flash" data="http://www.youtube.com/v/$1" ><param name="movie" value="http://www.youtube.com/v/$1"></param><!--[if IE]><embed src="http://www.youtube.com/v/$1" type="application/x-shockwave-flash" width="425" height="350" /><![endif]--></object>', $Text);
+
// oembed tag
$Text = oembed_bbcode2html($Text);