diff --git a/include/html2bbcode.php b/include/html2bbcode.php index 10a2fd13e5..7361501340 100644 --- a/include/html2bbcode.php +++ b/include/html2bbcode.php @@ -90,9 +90,11 @@ function html2bbcode($message) $message = str_replace("\r", "", $message); - $message = preg_replace_callback("|
([^<]*)
|ism", function($m) { + function _replace_code_cb($m){ return "".str_replace("\n","
\n",$m[1]). "
"; - }, $message); + } + + $message = preg_replace_callback("|
([^<]*)
|ism", "_replace_code_cb", $message); $message = str_replace(array( "
  • ",