git.shiar.nl
/
minimedit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
upload: common function to parse user text input
[minimedit.git]
/
upload.inc.php
diff --git
a/upload.inc.php
b/upload.inc.php
index c578a2dc66ab36c0d36c772ff00ea1ab7868aad4..ed9ee772eccf99f8595f69efd67ee16d57432b1d 100644
(file)
--- a/
upload.inc.php
+++ b/
upload.inc.php
@@
-37,3
+37,14
@@
function userupload($input, $target = NULL, $filename = NULL)
}
return $target;
}
+
+function messagehtml($input)
+{
+ # convert user textarea post to formatted html
+ if (empty($input)) {
+ return;
+ }
+ $html = htmlspecialchars($input);
+ $html = nl2br($html);
+ return "<p>$html</p>";
+}