JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
fine tweaks to upload.php
authorJason Woofenden <jason183@herkamire.com>
Tue, 17 Apr 2007 17:48:15 +0000 (13:48 -0400)
committerJason Woofenden <jason183@herkamire.com>
Tue, 17 Apr 2007 17:48:15 +0000 (13:48 -0400)
upload.php

index 0f2a237..143482c 100644 (file)
@@ -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");
        }