From 00de0ce0817f36b5acba70362a4c30c8fa7aaf11 Mon Sep 17 00:00:00 2001 From: Cassio de Campos Date: Mon, 31 Jul 2017 20:29:41 +0100 Subject: sanitising --- src/globals.php | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/globals.php') diff --git a/src/globals.php b/src/globals.php index ded3ba2..8b7bfb0 100755 --- a/src/globals.php +++ b/src/globals.php @@ -107,6 +107,17 @@ function sanitizeText($text, $doamp=true) $text = addslashes($text); return $text; } +function sanitizeFilename($text) +{ + $text = str_replace("&", "", $text); + $text = str_replace("<", "", $text); + $text = str_replace(">", "", $text); + $text = str_replace("\"", "", $text); + $text = str_replace("'", "", $text); + $text = str_replace("`", "", $text); + $text = addslashes($text); + return $text; +} function unsanitizeText($text) { $text = str_replace("&", "&", $text); -- cgit v1.2.3