diff options
author | friendica <info@friendica.com> | 2012-01-26 23:03:27 -0800 |
---|---|---|
committer | friendica <info@friendica.com> | 2012-01-26 23:03:27 -0800 |
commit | 3197a6e8aaacef1fb504c90d97f291f133151429 (patch) | |
tree | d2cfbdf86c60912be8a91ec0d2d3ed6fb15c5454 /include | |
parent | 8fe51682590c1f9badf2efc6b4f7fc1ddcc2c31e (diff) | |
download | volse-hubzilla-3197a6e8aaacef1fb504c90d97f291f133151429.tar.gz volse-hubzilla-3197a6e8aaacef1fb504c90d97f291f133151429.tar.bz2 volse-hubzilla-3197a6e8aaacef1fb504c90d97f291f133151429.zip |
fix some changes lost from another branch
Diffstat (limited to 'include')
-rwxr-xr-x | include/bb2diaspora.php | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/include/bb2diaspora.php b/include/bb2diaspora.php index ab124228d..d367b6716 100755 --- a/include/bb2diaspora.php +++ b/include/bb2diaspora.php @@ -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; } |