X-Git-Url: http://git.shiar.nl/minimedit.git/blobdiff_plain/ab3ebc53acde6f060649a01403a886f5485f7bf6..df71632cb8b7fff53a49fd9e81c201e96de9b764:/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", "

\n\n

"], + htmlspecialchars($input) + ); + return "

$html

"; +}