git.shiar.nl
/
minimedit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7718ed2
)
reply: convert CR in line breaks
author
Mischa POSLAWSKY
<perl@shiar.org>
Sat, 30 Nov 2019 23:12:46 +0000
(
00:12
+0100)
committer
Mischa POSLAWSKY
<perl@shiar.org>
Thu, 5 Dec 2019 18:02:07 +0000
(19:02 +0100)
Store submitted network/dos newlines as expected unix LF.
upload.inc.php
patch
|
blob
|
history
diff --git
a/upload.inc.php
b/upload.inc.php
index 4eff8a09cdcc07374e8ac7e6228bf6c797d0c174..afaa047303b3cf420872460325303056d791adf9 100644
(file)
--- 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('"(?:<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>";
}