From bf865f0210aee4c6742b10bb63cd05f0de9b9d12 Mon Sep 17 00:00:00 2001 From: Friendika Date: Sun, 10 Apr 2011 03:00:29 -0700 Subject: bug #34, line breaks double in retweet/share --- include/bbcode.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'include') 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
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 = "^\[\]"; -- cgit v1.2.3