aboutsummaryrefslogtreecommitdiffstats
path: root/include/bb2diaspora.php
diff options
context:
space:
mode:
authorFabio Comuni <fabrix.xm@gmail.com>2011-10-26 12:15:38 +0200
committerFabio Comuni <fabrix.xm@gmail.com>2011-10-26 12:15:38 +0200
commitdc212de9606422be6e912a0bb7f3569192942938 (patch)
tree5a253e3b57d14751214513a029d84699f5ad5b21 /include/bb2diaspora.php
parentbed0043b30c219a08aa0b352923299ea153d515c (diff)
parent6d6136cdb5a2149037c3cf315b3fa81a72bd7d55 (diff)
downloadvolse-hubzilla-dc212de9606422be6e912a0bb7f3569192942938.tar.gz
volse-hubzilla-dc212de9606422be6e912a0bb7f3569192942938.tar.bz2
volse-hubzilla-dc212de9606422be6e912a0bb7f3569192942938.zip
Merge remote-tracking branch 'friendika/master'
Diffstat (limited to 'include/bb2diaspora.php')
-rw-r--r--include/bb2diaspora.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/bb2diaspora.php b/include/bb2diaspora.php
index e2711755b..f7398067b 100644
--- a/include/bb2diaspora.php
+++ b/include/bb2diaspora.php
@@ -11,8 +11,12 @@ function diaspora2bb($s) {
$s = preg_replace('/\@\{(.+?)\; (.+?)\@(.+?)\}/','@[url=https://$3/u/$2]$1[/url]',$s);
$s = Markdown($s);
$s = html2bbcode($s);
+ $s = str_replace('&#42;','*',$s);
$s = preg_replace("/\[url\=?(.*?)\]https?:\/\/www.youtube.com\/watch\?v\=(.*?)\[\/url\]/ism",'[youtube]$2[/youtube]',$s);
+ $s = preg_replace("/\[url\=https?:\/\/www.youtube.com\/watch\?v\=(.*?)\].*?\[\/url\]/ism",'[youtube]$1[/youtube]',$s);
$s = preg_replace("/\[url\=?(.*?)\]https?:\/\/vimeo.com\/([0-9]+)(.*?)\[\/url\]/ism",'[vimeo]$2[/vimeo]',$s);
+ $s = preg_replace("/\[url\=https?:\/\/vimeo.com\/([0-9]+)\](.*?)\[\/url\]/ism",'[vimeo]$1[/vimeo]',$s);
+ $s = preg_replace("/([^\]\=]|^)(https?\:\/\/)(vimeo|youtu|www\.youtube|soundcloud)([a-zA-Z0-9\:\/\-\?\&\;\.\=\_\~\#\%\$\!\+\,]+)/ism", '$1[url]$2$3$4[/url]',$s);
return $s;
}