reply: convert CR in line breaks
[minimedit.git] / upload.inc.php
index 4eff8a09cdcc07374e8ac7e6228bf6c797d0c174..afaa047303b3cf420872460325303056d791adf9 100644 (file)
@@ -44,7 +44,10 @@ function messagehtml($input)
        if (empty($input)) {
                return;
        }
-       $html = htmlspecialchars($input);
-       $html = preg_replace('"(?:<br />){2}"', "</p>\n\n<p>", nl2br($html));
+       $html = preg_replace(
+               ["/\r?\n/", "'(?:<br />\n?){2}'"],
+               ["<br />\n", "</p>\n\n<p>"],
+               htmlspecialchars($input)
+       );
        return "<p>$html</p>";
 }