root

Changeset 461

Show
Ignore:
Timestamp:
01/05/09 22:36:52 (2 years ago)
Author:
wbond
Message:

Updated fUpload::validate() so it properly handles upload max filesize specified in human-readable notation

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • fUpload.php

    r459 r461 Hide Line Numbers
    1010 * @link       http://flourishlib.com/fUpload 
    1111 *  
    12  * @version    1.0.0b3 
     12 * @version    1.0.0b4 
     13 * @changes    1.0.0b4  Updated ::validate() so it properly handles upload max filesize specified in human-readable notation [wb, 2009-01-05] 
    1314 * @changes    1.0.0b3  Removed the dependency on fRequest [wb, 2009-01-05] 
    1415 * @changes    1.0.0b2  Fixed a bug with validating filesizes [wb, 2008-11-25] 
     
    287288        if ($file_array['error'] == UPLOAD_ERR_FORM_SIZE || $file_array['error'] == UPLOAD_ERR_INI_SIZE) { 
    288289            $max_size = (!empty($_POST['MAX_FILE_SIZE'])) ? $_POST['MAX_FILE_SIZE'] : ini_get('upload_max_filesize'); 
     290            $max_size = (!is_numeric($max_size)) ? fFilesystem::convertToBytes($max_size) : $max_size; 
    289291            throw new fValidationException( 
    290292                'The file uploaded is over the limit of %s',