From: Mischa POSLAWSKY
Date: Sat, 30 Nov 2019 23:12:46 +0000 (+0100)
Subject: reply: convert CR in line breaks
X-Git-Tag: v4.3~12
X-Git-Url: http://git.shiar.net/minimedit.git/commitdiff_plain/28b4486013bb2738dfa16f27b73862e287d7f04d
reply: convert CR in line breaks
Store submitted network/dos newlines as expected unix LF.
---
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
";
}