]> git.mjollnir.org Git - moodle.git/commitdiff
Added hyphen (-) to the list of allowed characters in a filename
authormoodler <moodler>
Fri, 16 May 2003 06:08:42 +0000 (06:08 +0000)
committermoodler <moodler>
Fri, 16 May 2003 06:08:42 +0000 (06:08 +0000)
lib/moodlelib.php

index ee69d5cb7074fa3d36c5b391710223be35d9d940..42ed7df0d078d2d2f1466e0d22d1a502dd6f0280 100644 (file)
@@ -949,7 +949,7 @@ function clean_filename($string) {
 /// Cleans a given filename by removing suspicious or troublesome characters
     $string = stripslashes($string);
     $string = eregi_replace("\.\.", "", $string);
-    $string = eregi_replace("[^([:alnum:]|\.)]", "_", $string);
+    $string = eregi_replace("[^(-|[:alnum:]|\.)]", "_", $string);
     return    eregi_replace("_+", "_", $string);
 }