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

"; +}