From dabdfec87e89ad579cf543608ad118f30981a1c5 Mon Sep 17 00:00:00 2001 From: Jason Woofenden Date: Thu, 3 May 2007 09:37:18 -0400 Subject: [PATCH] no dashes in filenames, improved image uploading, make_thumbnail() --- format.php | 4 +-- metaform.php | 2 +- metaform/template.html | 3 ++- metaform/template.php | 6 ++++- upload.php | 70 +++++++++++++++++++++++++++++++++++++++--------- 5 files changed, 67 insertions(+), 18 deletions(-) diff --git a/format.php b/format.php index 1bac609..a513722 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('^[0-9.-]*', '', $str); + $str = ereg_replace('[^a-z0-9_.]', '_', $str); + return ereg_replace('^[.]*', '', $str); } function format_varname($str) { diff --git a/metaform.php b/metaform.php index 5ba0f44..88dd437 100644 --- a/metaform.php +++ b/metaform.php @@ -224,8 +224,8 @@ function make_php() { } } else { $tem->sub('formats'); - $tem->sub('tem_sets'); } + $tem->sub('tem_sets'); if(!$always_field and $input != 'checkbox' and $input != 'radio') { $always_field = $name; } diff --git a/metaform/template.html b/metaform/template.html index 531f416..bd641dd 100644 --- a/metaform/template.html +++ b/metaform/template.html @@ -4,6 +4,7 @@ ~form_name~ entry