X-Git-Url: http://git.shiar.net/minimedit.git/blobdiff_plain/ab3ebc53acde6f060649a01403a886f5485f7bf6..17653d5b7ab2c7276c97b0953648fcb885383711:/upload.inc.php
diff --git a/upload.inc.php b/upload.inc.php
index aa24558..6175fe2 100644
--- a/upload.inc.php
+++ b/upload.inc.php
@@ -1,16 +1,34 @@
admin and preg_match('/\A<[a-z][^>]*>/', $input)) {
+ return $input; # allow html input as is if privileged
+ }
+ $html = preg_replace(
+ ["/\r?\n/", "'(?:
\n?){2}'"],
+ ["
\n", "
"], + htmlspecialchars($input) + ); + return "
$html
"; +}