X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=format.php;h=055e66d6eaa6234f83803d194799188fb1d17865;hb=4f94560f060a7305ea791def3950adb1bda092ec;hp=a513722a860a570c4805fe2b955ed6f9defc6016;hpb=dabdfec87e89ad579cf543608ad118f30981a1c5;p=wfpl.git diff --git a/format.php b/format.php index a513722..055e66d 100644 --- a/format.php +++ b/format.php @@ -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) { @@ -52,10 +52,10 @@ function format_unix($str) { } function format_yesno($str) { - if($str) { - return "Yes"; + if($str && $str != 'No') { + return 'Yes'; } else { - return "No"; + return 'No'; } }