aboutsummaryrefslogtreecommitdiffstats
path: root/include/bbcode.php
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-05-20 15:46:41 -0700
committerFriendika <info@friendika.com>2011-05-20 15:46:41 -0700
commit0abf2f11c6b3caaad2f9a833f477a094b7488e9a (patch)
tree07ed57fe2b3c17fe8b688b3472579ee770cdc1a0 /include/bbcode.php
parent5f20925220574323e8d32483e57ef9ebbf0b3256 (diff)
downloadvolse-hubzilla-0abf2f11c6b3caaad2f9a833f477a094b7488e9a.tar.gz
volse-hubzilla-0abf2f11c6b3caaad2f9a833f477a094b7488e9a.tar.bz2
volse-hubzilla-0abf2f11c6b3caaad2f9a833f477a094b7488e9a.zip
patches for youtube's change in link and embed formats, please test
Diffstat (limited to 'include/bbcode.php')
-rw-r--r--include/bbcode.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/bbcode.php b/include/bbcode.php
index 89a14988a..195fc9181 100644
--- a/include/bbcode.php
+++ b/include/bbcode.php
@@ -94,7 +94,11 @@ function bbcode($Text,$preserve_nl = false) {
// Youtube extensions
$Text = preg_replace("/\[youtube\]https?:\/\/www.youtube.com\/watch\?v\=(.+?)\[\/youtube\]/",'[youtube]$1[/youtube]',$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\]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" allowfullscreen></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);
// oembed tag
$Text = oembed_bbcode2html($Text);