Changeset 2671

Show
Ignore:
Timestamp:
05/13/08 15:27:07 (2 months ago)
Author:
Shadowhand
Message:

Fixing a bug in upload::type() and upload::size() that would cause an empty file upload to fail.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/system/helpers/upload.php

    r2648 r2671  
    100100        public static function type(array $file, array $allowed_types) 
    101101        { 
     102                if ((int) $file['error'] !== UPLOAD_ERR_OK) 
     103                        return TRUE; 
     104 
    102105                // Get the default extension of the file 
    103106                $extension = strtolower(file::extension($file['name'])); 
     
    122125        public function size(array $file, array $size) 
    123126        { 
     127                if ((int) $file['error'] !== UPLOAD_ERR_OK) 
     128                        return TRUE; 
     129 
    124130                // Only one size is allowed 
    125131                $size = strtoupper($size[0]);