- Timestamp:
- 01/05/09 22:13:14 (2 years ago)
- Files:
-
- fUpload.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
fUpload.php
r448 r459 Hide Line Numbers 3 3 * Provides validation and movement of uploaded files 4 4 * 5 * @copyright Copyright (c) 2007-200 8Will Bond5 * @copyright Copyright (c) 2007-2009 Will Bond 6 6 * @author Will Bond [wb] <will@flourishlib.com> 7 7 * @license http://flourishlib.com/license … … 10 10 * @link http://flourishlib.com/fUpload 11 11 * 12 * @version 1.0.0b1 13 * @changes 1.0.0b1 Fixed a bug with validating filesizes [wb, 2008-11-25] 12 * @version 1.0.0b3 13 * @changes 1.0.0b3 Removed the dependency on fRequest [wb, 2009-01-05] 14 * @changes 1.0.0b2 Fixed a bug with validating filesizes [wb, 2008-11-25] 14 15 * @changes 1.0.0b The initial implementation [wb, 2007-06-14] 15 16 */ … … 29 30 static public function check($field) 30 31 { 31 if ( fRequest::check($field) && $_SERVER['REQUEST_METHOD'] != 'POST') {32 if (isset($_GET[$field]) && $_SERVER['REQUEST_METHOD'] != 'POST') { 32 33 throw new fProgrammerException( 33 34 'Missing method="post" attribute in form tag' … … 35 36 } 36 37 37 if ( fRequest::check($field) && (!isset($_SERVER['CONTENT_TYPE']) || stripos($_SERVER['CONTENT_TYPE'], 'multipart/form-data') === FALSE)) {38 if (isset($_POST[$field]) && (!isset($_SERVER['CONTENT_TYPE']) || stripos($_SERVER['CONTENT_TYPE'], 'multipart/form-data') === FALSE)) { 38 39 throw new fProgrammerException( 39 40 'Missing enctype="multipart/form-data" attribute in form tag' … … 285 286 286 287 if ($file_array['error'] == UPLOAD_ERR_FORM_SIZE || $file_array['error'] == UPLOAD_ERR_INI_SIZE) { 287 $max_size = ( fRequest::get('MAX_FILE_SIZE')) ? fRequest::get('MAX_FILE_SIZE'): ini_get('upload_max_filesize');288 $max_size = (!empty($_POST['MAX_FILE_SIZE'])) ? $_POST['MAX_FILE_SIZE'] : ini_get('upload_max_filesize'); 288 289 throw new fValidationException( 289 290 'The file uploaded is over the limit of %s', … … 320 321 321 322 /** 322 * Copyright (c) 2007-200 8Will Bond <will@flourishlib.com>323 * Copyright (c) 2007-2009 Will Bond <will@flourishlib.com> 323 324 * 324 325 * Permission is hereby granted, free of charge, to any person obtaining a copy
