Changeset 2118

Show
Ignore:
Timestamp:
02/21/2008 07:34:59 PM (8 months ago)
Author:
Shadowhand
Message:

Fixing #410, thanks jachacy.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/modules/forge/libraries/Form_Upload.php

    r2117 r2118  
    171171        public function rule_size($size) 
    172172        { 
     173                // Skip the field if it is empty 
     174                if (empty($this->upload) OR $this->upload['error'] === UPLOAD_ERR_NO_FILE) 
     175                        return; 
     176 
    173177                $bytes = (int) $size; 
    174178 
     
    181185                } 
    182186 
    183                 if ( ! empty($this->upload) AND (empty($this->upload['size']) OR $this->upload['size'] > $bytes)) 
     187                if (empty($this->upload['size']) OR $this->upload['size'] > $bytes) 
    184188                { 
    185189                        $this->errors['max_size'] = array($size);