upload: common function to parse user text input
[minimedit.git] / upload.inc.php
index c578a2dc66ab36c0d36c772ff00ea1ab7868aad4..ed9ee772eccf99f8595f69efd67ee16d57432b1d 100644 (file)
@@ -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>";
+}