]> git.mjollnir.org Git - moodle.git/commitdiff
fixed bug 1037 by improving clean_filename()
authorgustav_delius <gustav_delius>
Fri, 7 May 2004 17:07:31 +0000 (17:07 +0000)
committergustav_delius <gustav_delius>
Fri, 7 May 2004 17:07:31 +0000 (17:07 +0000)
lib/moodlelib.php

index f639ffff2341b3ea26cc8bd2ebfeb8af026a49ad..5fafa85170fd584cf56c5f31f6e40dba0870fdcb 100644 (file)
@@ -1620,7 +1620,7 @@ function clean_filename($string) {
 ///    alphanumeric _ - . 
 
     $string = eregi_replace("\.\.+", "", $string);
-    $string = preg_replace('/[^\.\w-]/','_', $string ); // only allowed chars
+    $string = preg_replace('/[^\.a-zA-Z\d\_-]/','_', $string ); // only allowed chars
     $string = eregi_replace("_+", "_", $string);
     return    $string;
 }