mirror of
https://github.com/friendica/friendica
synced 2025-04-26 01:10:15 +00:00
bug #34, line breaks double in retweet/share
This commit is contained in:
parent
6b66ac8183
commit
bf865f0210
3 changed files with 6 additions and 3 deletions
|
@ -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 = "^\[\]";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue