aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCassio de Campos <cassiopc@gmail.com>2017-08-13 13:49:38 +0000
committerCassio de Campos <cassiopc@gmail.com>2017-08-13 13:49:38 +0000
commit703cbedd399c902b3321dcb46c7825c5918e8aed (patch)
tree1d23405740bdd22f8fae72744cbf3d2480d20487
parenta49c51d0a62cfce7b8ceebdccd218c1ad02e4296 (diff)
downloadboca-703cbedd399c902b3321dcb46c7825c5918e8aed.tar.gz
boca-703cbedd399c902b3321dcb46c7825c5918e8aed.zip
better sanitize filenames
-rwxr-xr-xsrc/globals.php22
1 files changed, 11 insertions, 11 deletions
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;
}