]> git.mxchange.org Git - friendica.git/commitdiff
bug #34, line breaks double in retweet/share
authorFriendika <info@friendika.com>
Sun, 10 Apr 2011 10:00:29 +0000 (03:00 -0700)
committerFriendika <info@friendika.com>
Sun, 10 Apr 2011 10:00:29 +0000 (03:00 -0700)
boot.php
include/bbcode.php
mod/share.php

index 6dd433fd832044088a536b4c77a30927b169150a..3331c98671453263d690db4d59f653ea49a8b6e5 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -2,7 +2,7 @@
 
 set_time_limit(0);
 
-define ( 'FRIENDIKA_VERSION',      '2.1.943' );
+define ( 'FRIENDIKA_VERSION',      '2.1.944' );
 define ( 'DFRN_PROTOCOL_VERSION',  '2.2'  );
 define ( 'DB_UPDATE_VERSION',      1047   );
 
index 44f571450947858598fec51d00619a405536c075..6fadbaf7eb4d81536c4a8cecb917c36d45e76eb7 100644 (file)
@@ -3,7 +3,7 @@ require_once("include/oembed.php");
        // BBcode 2 HTML was written by WAY2WEB.net
        // extended to work with Mistpark/Friendika - Mike Macgirvin
 
-function bbcode($Text) {
+function bbcode($Text,$preserve_nl = false) {
 
        // Replace any html brackets with HTML Entities to prevent executing HTML or script
        // Don't use strip_tags here because it breaks [url] search by replacing & with amp
@@ -12,7 +12,10 @@ function bbcode($Text) {
        $Text = str_replace(">", "&gt;", $Text);
 
        // Convert new line chars to html <br /> tags
+
        $Text = nl2br($Text);
+       if($preserve_nl)
+               $Text = str_replace(array("\n","\r"), array('',''),$Text);
 
        // Set up the parameters for a URL search string
        $URLSearchString = "^\[\]";
index 8a8229e8a19f1f7a1a32e907b8a4471dfc686e2a..94cd035b41a3aba610f7440b86859bf8f482e287 100644 (file)
@@ -17,7 +17,7 @@ function share_init(&$a) {
        $o = '';
 
        $o .= '&#x2672; <a href="' . $r[0]['author-link'] . '">' . $r[0]['author-name'] . '</a><br />';
-       $o .= prepare_body($r[0]);
+       $o .= bbcode($r[0]['body'], true);
        echo $o . '<br />';
        killme();  
 }
\ No newline at end of file