]> git.mjollnir.org Git - moodle.git/commitdiff
Modified the clean_filename() function to strip parenthesis and slashes.
authorstronk7 <stronk7>
Wed, 14 Apr 2004 18:09:41 +0000 (18:09 +0000)
committerstronk7 <stronk7>
Wed, 14 Apr 2004 18:09:41 +0000 (18:09 +0000)
Not really sure if the method used is 100% correct ot no so, if you can
check it....
Perhpas I should make the stripping in backup process, istead of using this
central function. What do you think?

lib/moodlelib.php

index 22881e3ccef79714e7e274d73529b6d2d65710a9..658253f491dc6a2476e500d9e0a6eba49d4fa1e3 100644 (file)
@@ -1610,6 +1610,9 @@ function clean_filename($string) {
     $string = eregi_replace("\.\.", "", $string);
     $string = eregi_replace("[^(-|[:alnum:]|\.)]", "_", $string);
     $string = eregi_replace(",", "_", $string);
+    $string = eregi_replace("/", "_", $string);
+    $string = eregi_replace("\(", "_", $string);
+    $string = eregi_replace("\)", "_", $string);
     return    eregi_replace("_+", "_", $string);
 }