diff options
-rw-r--r-- | boot.php | 2 | ||||
-rw-r--r-- | include/bbcode.php | 5 | ||||
-rw-r--r-- | mod/share.php | 2 |
3 files changed, 6 insertions, 3 deletions
@@ -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 ); diff --git a/include/bbcode.php b/include/bbcode.php index 44f571450..6fadbaf7e 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -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(">", ">", $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 = "^\[\]"; diff --git a/mod/share.php b/mod/share.php index 8a8229e8a..94cd035b4 100644 --- a/mod/share.php +++ b/mod/share.php @@ -17,7 +17,7 @@ function share_init(&$a) { $o = ''; $o .= '♲ <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 |