From: Jason Woofenden Date: Tue, 17 Apr 2007 17:48:15 +0000 (-0400) Subject: fine tweaks to upload.php X-Git-Url: https://jasonwoof.com/gitweb/?p=wfpl.git;a=commitdiff_plain;h=349ec547cd4bda41fe3b47b8ce4e231a389956e2 fine tweaks to upload.php --- 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"); }