git.shiar.nl
/
minimedit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
reply: accept image uploads with messages
[minimedit.git]
/
upload.inc.php
diff --git
a/upload.inc.php
b/upload.inc.php
index ed9ee772eccf99f8595f69efd67ee16d57432b1d..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 = nl2br($html);
+ $html = preg_replace(
+ ["/\r?\n/", "'(?:<br />\n?){2}'"],
+ ["<br />\n", "</p>\n\n<p>"],
+ htmlspecialchars($input)
+ );
return "<p>$html</p>";
}