]> git.mxchange.org Git - friendica.git/blobdiff - include/bb2diaspora.php
Merge pull request #3281 from annando/issue-3206-2957
[friendica.git] / include / bb2diaspora.php
index eaf418510bacd0236ff59d0d4e03040a84362451..03eff5a6b73a5bd2c398d11fe8c4d448110a1497 100644 (file)
@@ -59,15 +59,6 @@ function diaspora2bb($s) {
 
        $s = str_replace('#', '#', $s);
 
-       $search = array(" \n", "\n ");
-       $replace = array("\n", "\n");
-       do {
-               $oldtext = $s;
-               $s = str_replace($search, $replace, $s);
-       } while ($oldtext != $s);
-
-       $s = str_replace("\n\n", '<br>', $s);
-
        $s = html2bbcode($s);
 
        // protect the recycle symbol from turning into a tag, but without unescaping angles and naked ampersands
@@ -193,7 +184,7 @@ function unescape_underscores_in_links($m) {
 
 function format_event_diaspora($ev) {
 
-       if (! ((is_array($ev)) && count($ev)))
+       if(! ((is_array($ev)) && count($ev)))
                return '';
 
        $bd_format = t('l F d, Y \@ g:i A') ; // Friday January 18, 2011 @ 8 AM
@@ -209,7 +200,7 @@ function format_event_diaspora($ev) {
                        $ev['start'] , $bd_format)))
                .  '](' . App::get_baseurl() . '/localtime/?f=&time=' . urlencode(datetime_convert('UTC','UTC',$ev['start'])) . ")\n";
 
-       if (! $ev['nofinish'])
+       if(! $ev['nofinish'])
                $o .= t('Finishes:') . ' ' . '['
                        . (($ev['adjust']) ? day_translate(datetime_convert('UTC', 'UTC',
                                $ev['finish'] , $bd_format ))
@@ -217,7 +208,7 @@ function format_event_diaspora($ev) {
                                $ev['finish'] , $bd_format )))
                        . '](' . App::get_baseurl() . '/localtime/?f=&time=' . urlencode(datetime_convert('UTC','UTC',$ev['finish'])) . ")\n";
 
-       if (strlen($ev['location']))
+       if(strlen($ev['location']))
                $o .= t('Location:') . bb2diaspora($ev['location'])
                        . "\n";