fix some changes lost from another branch

This commit is contained in:
friendica 2012-01-26 23:03:27 -08:00
parent 8fe5168259
commit 3197a6e8aa
3 changed files with 10 additions and 8 deletions

View file

@ -20,9 +20,6 @@ function diaspora2bb($s) {
$s = html2bbcode($s);
// $s = str_replace('*','*',$s);
// we seem to get a lot of text smushed together with links from Diaspora.
// if it's a url that we haven't already parsed into a bbcode structure, put a space before it.
$s = preg_replace("/([^=\"\]])(https?:\/\/)/ism",'$1 $2',$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);
@ -32,6 +29,12 @@ function diaspora2bb($s) {
// remove duplicate adjacent code tags
$s = preg_replace("/(\[code\])+(.*?)(\[\/code\])+/ism","[code]$2[/code]", $s);
$s = scale_diaspora_images($s);
// we seem to get a lot of text smushed together with links from Diaspora.
$s = preg_replace('/[^ ]\[url\=(.*?)\]/',' [url=$1]' ,$s);
$s = preg_replace('/\[\/url\][^ ]/','[/url] ',$s);
return $s;
}