From 28b4486013bb2738dfa16f27b73862e287d7f04d Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Sun, 1 Dec 2019 00:12:46 +0100 Subject: [PATCH] reply: convert CR in line breaks Store submitted network/dos newlines as expected unix LF. --- upload.inc.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/upload.inc.php b/upload.inc.php index 4eff8a0..afaa047 100644 --- a/upload.inc.php +++ b/upload.inc.php @@ -44,7 +44,10 @@ function messagehtml($input) if (empty($input)) { return; } - $html = htmlspecialchars($input); - $html = preg_replace('"(?:
){2}"', "

\n\n

", nl2br($html)); + $html = preg_replace( + ["/\r?\n/", "'(?:
\n?){2}'"], + ["
\n", "

\n\n

"], + htmlspecialchars($input) + ); return "

$html

"; } -- 2.30.0