JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
Oh yeah, and now hyphens are allowed in filenames (just not at the beginning)
[wfpl.git] / format.php
index cf59504..055e66d 100644 (file)
@@ -32,8 +32,8 @@ function format_zip($str) {
 
 function format_filename($str) {
        $str = strtolower($str);
-       $str = ereg_replace('[^a-z0-9_.]', '_', $str);
-       return ereg_replace('^[.]*', '', $str);
+       $str = ereg_replace('[^a-z0-9_.-]', '_', $str);
+       return ereg_replace('^[.-]', '_', $str);
 }
 
 function format_varname($str) {