From: Jason Woofenden Date: Thu, 3 May 2007 05:28:37 +0000 (-0400) Subject: Merge branch 'master' of /home/jason/dev/git/wfpl X-Git-Url: https://jasonwoof.com/gitweb/?a=commitdiff_plain;h=cf7a90640ded556566c93932c4c56c1c7a1ffdae;hp=3fe51eb4200cbdf74db551f31582d6b80881eef7;p=wfpl.git Merge branch 'master' of /home/jason/dev/git/wfpl --- 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"); }