From 349ec547cd4bda41fe3b47b8ce4e231a389956e2 Mon Sep 17 00:00:00 2001 From: Jason Woofenden Date: Tue, 17 Apr 2007 13:48:15 -0400 Subject: [PATCH] fine tweaks to upload.php --- upload.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/upload.php b/upload.php index 0f2a237..143482c 100644 --- a/upload.php +++ b/upload.php @@ -65,6 +65,7 @@ $GLOBALS['mime_to_ext'] = array( 'text/plain' => 'txt', 'text/html' => 'html', 'image/jpeg' => 'jpg', + 'image/jpe' => 'jpg', 'image/jpg' => 'jpg', 'image/gif' => 'gif', 'image/png' => 'png', @@ -116,7 +117,7 @@ function generate_filename($path, $mime = 'text/plain') { # replace symbols with underscores $filename = ereg_replace('[^a-z0-9_.]', '_', $filename); - # remove dots from the begning (no invisible files) + # remove dots from the beginning (no invisible files) $filename = ereg_replace('^\.*', '', $filename); # fix extension @@ -181,7 +182,7 @@ function gif_to_png($filename, $new_filename = 'just change extension') { if(!file_exists($convert)) { $convert = `which convert`; } - if(!file_exists($convert)) { + if($convert == '' || !file_exists($convert)) { die("can't find imagemagick's 'convert' program"); } -- 1.7.10.4