X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=inline;f=include%2Fbbcode.php;h=89a14988a26709663a65043c329b6fca63847d00;hb=2c63b65e3c66bcb0a047ce51c04d23376aa6c525;hp=9e5f5a3711c7504adea322981253c70de7f9f480;hpb=58309829a1fd45b7dec6ac0f0ca9290a7d0b0721;p=friendica.git
diff --git a/include/bbcode.php b/include/bbcode.php
index 9e5f5a3711..89a14988a2 100644
--- a/include/bbcode.php
+++ b/include/bbcode.php
@@ -1,9 +1,9 @@
", ">", $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 = " a-zA-Z0-9\:\/\-\?\&\.\=\_\~\#\'\%";
+ $URLSearchString = "^\[\]";
// Set up the parameters for a MAIL search string
- $MAILSearchString = $URLSearchString . " a-zA-Z0-9\.@";
+ $MAILSearchString = $URLSearchString;
// Perform URL Search
- $Text = preg_replace("/([^\]\=]|^)(https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\.\=\_\~\#\'\%]+)/", ' $2', $Text);
+ $Text = preg_replace("/([^\]\=]|^)(https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\.\=\_\~\#\'\%\$\!\+\,]+)/", ' $2', $Text);
- $Text = preg_replace("/\[url\]([$URLSearchString]*)\[\/url\]/", '$1', $Text);
- $Text = preg_replace("(\[url\=([$URLSearchString]*)\](.+?)\[/url\])", '$2', $Text);
+ $Text = preg_replace("/\[url\]([$URLSearchString]*)\[\/url\]/", '$1', $Text);
+ $Text = preg_replace("(\[url\=([$URLSearchString]*)\](.+?)\[/url\])", '$2', $Text);
//$Text = preg_replace("(\[url\=([$URLSearchString]*)\]([$URLSearchString]*)\[/url\])", '$2', $Text);
@@ -49,10 +52,10 @@ function bbcode($Text) {
$Text = preg_replace("(\[o\](.+?)\[\/o\])is",'$1',$Text);
// Check for colored text
- $Text = preg_replace("(\[color=(.+?)\](.+?)\[\/color\])is","$2",$Text);
+ $Text = preg_replace("(\[color=(.+?)\](.+?)\[\/color\])is","$2",$Text);
// Check for sized text
- $Text = preg_replace("(\[size=(.+?)\](.+?)\[\/size\])is","$2",$Text);
+ $Text = preg_replace("(\[size=(.+?)\](.+?)\[\/size\])is","$2",$Text);
// Check for list text
$Text = preg_replace("/\[list\](.+?)\[\/list\]/is", '