From: Jason Woofenden Date: Thu, 14 Jun 2007 04:05:44 +0000 (-0400) Subject: Oh yeah, and now hyphens are allowed in filenames (just not at the beginning) X-Git-Url: https://jasonwoof.com/gitweb/?a=commitdiff_plain;h=9a9b08360777629b46e7b83bd4f5f091a249be21;hp=-c;p=wfpl.git Oh yeah, and now hyphens are allowed in filenames (just not at the beginning) --- 9a9b08360777629b46e7b83bd4f5f091a249be21 diff --combined dwt.php index d07abd8,49fac82..6cd2d66 --- a/dwt.php +++ b/dwt.php @@@ -18,7 -18,7 +18,7 @@@ # along with wfpl; if not, write to the Free Software Foundation, Inc., 51 # Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - require_once('code/wfpl/misc.php'); + require_once('code/wfpl/file.php'); function dwt_reset() { $GLOBALS['_dwt_keys'] = array(''); @@@ -61,19 -61,15 +61,19 @@@ function dwt_find($name) return dwt_find_raw(""); } -function dwt_append($name, $value) { - $index = dwt_find($name); +function dwt_append_raw($name, $value) { + $index = dwt_find_raw($name); if($index !== null) { $GLOBALS['_dwt_values'][$index] .= $value; } else { - dwt_set($name, $value); + dwt_set_raw($name, $value); } } +function dwt_append($name, $value) { + dwt_append_raw("", $value); +} + function dwt_output($filename = null) { if($filename !== null) { dwt_load($filename); diff --combined format.php index 1fc74af,cf59504..055e66d --- a/format.php +++ b/format.php @@@ -32,8 -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 +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'; } }