+
+function messagehtml($input)
+{
+ # convert user textarea post to formatted html
+ if (empty($input)) {
+ return;
+ }
+ $html = htmlspecialchars($input);
+ $html = preg_replace('"(?:<br />){2}"', "</p>\n\n<p>", nl2br($html));
+ return "<p>$html</p>";
+}