Added hyphen (-) to the list of allowed characters in a filename

This commit is contained in:
moodler 2003-05-16 06:08:42 +00:00
parent 60a60432a1
commit 5c219ea46d

View 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);
}