page: reload error page within fail handler
[minimedit.git] / upload.inc.php
index c578a2dc66ab36c0d36c772ff00ea1ab7868aad4..4eff8a09cdcc07374e8ac7e6228bf6c797d0c174 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 = preg_replace('"(?:<br />){2}"', "</p>\n\n<p>", nl2br($html));
+       return "<p>$html</p>";
+}