From c69fca50ee81ff74cda860aad339d4185d32e194 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Tue, 17 Aug 2010 16:09:07 +0200 Subject: [PATCH] Add option to escape PMA_sanitize output. This is required when it is used in form values. --- libraries/sanitizing.lib.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libraries/sanitizing.lib.php b/libraries/sanitizing.lib.php index 388ca1397..abac19da9 100644 --- a/libraries/sanitizing.lib.php +++ b/libraries/sanitizing.lib.php @@ -17,7 +17,7 @@ * * @access public */ -function PMA_sanitize($message) +function PMA_sanitize($message, $escape = false) { $replace_pairs = array( '<' => '<', @@ -65,6 +65,10 @@ function PMA_sanitize($message) $message = preg_replace($pattern, '', $message); } + if ($escape) { + $message = htmlspecialchars($message); + } + return $message; } ?>