From ce7a3615b51ee3247cb5c15996337cadc8cf644e Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 13 Nov 2011 19:04:59 -0800 Subject: d* - remove dupe bbcode code tags --- include/bb2diaspora.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/bb2diaspora.php') diff --git a/include/bb2diaspora.php b/include/bb2diaspora.php index 6b0589c43..8110d3e75 100644 --- a/include/bb2diaspora.php +++ b/include/bb2diaspora.php @@ -22,6 +22,8 @@ function diaspora2bb($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); + // remove duplicate adjacent code tags + $s = preg_replace("/(\[code\])+(.*?)(\[\/code\])+/ism","[code]$2[/code]", $s); $s = scale_diaspora_images($s); return $s; } -- cgit v1.2.3