From 703cbedd399c902b3321dcb46c7825c5918e8aed Mon Sep 17 00:00:00 2001 From: Cassio de Campos Date: Sun, 13 Aug 2017 14:49:38 +0100 Subject: better sanitize filenames --- src/globals.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/globals.php b/src/globals.php index ed04bd7..cb7c419 100755 --- a/src/globals.php +++ b/src/globals.php @@ -109,17 +109,17 @@ function sanitizeText($text, $doamp=true) } 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 = str_replace("<", "", $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 = str_replace(")", "_", $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 = str_replace("'", "_", $text); + $text = str_replace("`", "_", $text); $text = addslashes($text); return $text; } -- cgit v1.2.3