diff options
author | Fabio Comuni <fabrix.xm@gmail.com> | 2011-12-19 18:04:04 +0100 |
---|---|---|
committer | Fabio Comuni <fabrix.xm@gmail.com> | 2011-12-19 18:04:04 +0100 |
commit | 2a3f94e4521f00142b99ba4fa5f4ec093159cbb7 (patch) | |
tree | 35dc0c015976fbba09d48b48c6dd1850be3bff53 /include/bbcode.php | |
parent | c3d12bc77ea3af6adc72f078d06bb9b199af6b45 (diff) | |
parent | 177af1fc9d286c4ecc7e5ce43e17f492b9e11817 (diff) | |
download | volse-hubzilla-2a3f94e4521f00142b99ba4fa5f4ec093159cbb7.tar.gz volse-hubzilla-2a3f94e4521f00142b99ba4fa5f4ec093159cbb7.tar.bz2 volse-hubzilla-2a3f94e4521f00142b99ba4fa5f4ec093159cbb7.zip |
Merge remote-tracking branch 'friendica/master'
Diffstat (limited to 'include/bbcode.php')
-rw-r--r-- | include/bbcode.php | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/include/bbcode.php b/include/bbcode.php index 15b2ebb0a..a8e3bed70 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -11,6 +11,7 @@ function stripcode_br_cb($s) { function tryoembed($match){ $url = ((count($match)==2)?$match[1]:$match[2]); + logger('tryoembed: $url'); $o = oembed_fetch_url($url); @@ -180,22 +181,18 @@ function bbcode($Text,$preserve_nl = false) { $Text = preg_replace("/\[iframe\](.*?)\[\/iframe\]/ism", '<iframe src="$1" width="425" height="350"><a href="$1">$1</a></iframe>', $Text); - /*if (get_pconfig(local_user(), 'oembed', 'use_for_youtube' )==1){ - // use oembed for youtube links - $Text = preg_replace("/\[youtube\]/",'[embed]',$Text); - $Text = preg_replace("/\[\/youtube\]/",'[/embed]',$Text); - } else {*/ - // Youtube extensions - $Text = preg_replace_callback("/\[youtube\](https?:\/\/www.youtube.com\/watch\?v\=.*?)\[\/youtube\]/ism", 'tryoembed', $Text); - $Text = preg_replace_callback("/\[youtube\](https?:\/\/youtu.be\/.*?)\[\/youtube\]/ism",'tryoembed',$Text); + // Youtube extensions + $Text = preg_replace_callback("/\[youtube\](https?:\/\/www.youtube.com\/watch\?v\=.*?)\[\/youtube\]/ism", 'tryoembed', $Text); + $Text = preg_replace_callback("/\[youtube\](www.youtube.com\/watch\?v\=.*?)\[\/youtube\]/ism", 'tryoembed', $Text); + $Text = preg_replace_callback("/\[youtube\](https?:\/\/youtu.be\/.*?)\[\/youtube\]/ism",'tryoembed',$Text); - $Text = preg_replace("/\[youtube\]https?:\/\/www.youtube.com\/watch\?v\=(.*?)\[\/youtube\]/ism",'[youtube]$1[/youtube]',$Text); - $Text = preg_replace("/\[youtube\]https?:\/\/www.youtube.com\/embed\/(.*?)\[\/youtube\]/ism",'[youtube]$1[/youtube]',$Text); - $Text = preg_replace("/\[youtube\]https?:\/\/youtu.be\/(.*?)\[\/youtube\]/ism",'[youtube]$1[/youtube]',$Text); + $Text = preg_replace("/\[youtube\]https?:\/\/www.youtube.com\/watch\?v\=(.*?)\[\/youtube\]/ism",'[youtube]$1[/youtube]',$Text); + $Text = preg_replace("/\[youtube\]https?:\/\/www.youtube.com\/embed\/(.*?)\[\/youtube\]/ism",'[youtube]$1[/youtube]',$Text); + $Text = preg_replace("/\[youtube\]https?:\/\/youtu.be\/(.*?)\[\/youtube\]/ism",'[youtube]$1[/youtube]',$Text); - $Text = preg_replace("/\[youtube\]([A-Za-z0-9\-_=]+)(.*?)\[\/youtube\]/ism", '<iframe width="425" height="350" src="http://www.youtube.com/embed/$1" frameborder="0" ></iframe>', $Text); - //} + $Text = preg_replace("/\[youtube\]([A-Za-z0-9\-_=]+)(.*?)\[\/youtube\]/ism", '<iframe width="425" height="350" src="http://www.youtube.com/embed/$1" frameborder="0" ></iframe>', $Text); + $Text = preg_replace_callback("/\[vimeo\](https?:\/\/player.vimeo.com\/video\/[0-9]+).*?\[\/vimeo\]/ism",'tryoembed',$Text); $Text = preg_replace_callback("/\[vimeo\](https?:\/\/vimeo.com\/[0-9]+).*?\[\/vimeo\]/ism",'tryoembed',$Text); |