X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fbb2diaspora.php;h=b70a056619f9b8f927fc53032982e11dd859bf7f;hb=660bd39efad52b1c69bd8dd0ca27141b81f84ca5;hp=0ffbf0a14464fd8d4dc2bf9f2ab63953c4147bcf;hpb=b01520babfdb11212fc5519168d95d4ff6629a80;p=friendica.git diff --git a/include/bb2diaspora.php b/include/bb2diaspora.php index 0ffbf0a144..b70a056619 100644 --- a/include/bb2diaspora.php +++ b/include/bb2diaspora.php @@ -63,7 +63,8 @@ function bb2diaspora($Text,$preserve_nl = false, $fordiaspora = true) { /** * Transform #tags, strip off the [url] and replace spaces with underscore */ - $Text = preg_replace_callback('/#\[url\=(\w+.*?)\](\w+.*?)\[\/url\]/i', create_function('$match', + $URLSearchString = "^\[\]"; + $Text = preg_replace_callback("/#\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/i", create_function('$match', 'return \'#\'. str_replace(\' \', \'_\', $match[2]);' ), $Text); @@ -77,7 +78,7 @@ function bb2diaspora($Text,$preserve_nl = false, $fordiaspora = true) { else { $Text = bbcode($Text, $preserve_nl, false, 4); // Libertree doesn't convert a harizontal rule if there isn't a linefeed - $Text = str_replace("
", "\n
", $Text); + $Text = str_replace("
", "

", $Text); } // Now convert HTML to Markdown