X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=include%2Fhtml2bbcode.php;h=28e251aee4e82425a0fd0c88574558c43f701dd7;hb=0ed299a4950edf5c7c9a22cdebef1d778bcedff9;hp=1021bcdf165639e19f856a9669fd711b475ca9af;hpb=bf0f7c3d0aae1084f31e7a561e8281123b94f09f;p=friendica.git
diff --git a/include/html2bbcode.php b/include/html2bbcode.php
index 1021bcdf16..28e251aee4 100644
--- a/include/html2bbcode.php
+++ b/include/html2bbcode.php
@@ -85,20 +85,25 @@ function deletenode(&$doc, $node)
$child->parentNode->removeChild($child);
}}
+function _replace_code_cb($m){
+ return "".str_replace("\n","
";
+}
+
function html2bbcode($message)
{
- //$file = tempnam("/tmp/", "html");
- //file_put_contents($file, $message);
-
$message = str_replace("\r", "", $message);
+ $message = preg_replace_callback("|
\n",$m[1]). "
([^<]*)
|ism", "_replace_code_cb", $message);
+
$message = str_replace(array(
"", - "