Changeset 415 for trunk/lib/Upload.inc.php
- Timestamp:
- Jul 1, 2013 7:45:33 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/Upload.inc.php
r396 r415 279 279 // Check to be sure the file has a valid file name extension. 280 280 if (!in_array(mb_strtolower($this->getFilenameExtension($file_name)), $this->getParam('valid_file_extensions'))) { 281 /// TODO: Add option to allow any extention to be uploaded. 281 282 $this->_raiseMsg(sprintf(_("The file %s failed uploading: it is an unrecognized type. Files must have one of the following file name extensions: %s."), $file_name, join(', ', $this->getParam('valid_file_extensions'))), MSG_ERR, __FILE__, __LINE__); 282 283 $app->logMsg(sprintf('The uploaded file %s has an unrecognized file name extension.', $file_name), LOG_WARNING, __FILE__, __LINE__); … … 295 296 // If the file name has no extension, use the mime-type to choose one. 296 297 if (!preg_match('/\.[^.]{1,5}$/', $file_name) && function_exists('mime_content_type')) { 298 // TODO: will this run if an extention is filtered by 'valid_file_extensions'? 297 299 if ($ext = array_search(mime_content_type($files['tmp_name'][$i]), $this->mime_extension_map)) { 298 300 $file_name .= ".$ext";
Note: See TracChangeset
for help on using the changeset viewer.