diff options
author | Bharat Mediratta <bharat@menalto.com> | 2009-11-24 19:20:36 -0800 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2009-11-24 19:20:36 -0800 |
commit | 9b6663f87a7e679ffba691cf516191fc840cf978 (patch) | |
tree | 20cf9f3aaf93b4ba69d282dcf10d259db4a752de /system/helpers/upload.php | |
parent | 82ee5f9d338017c69331b2907f37a468ced8c66e (diff) |
Update to Kohana r4684 which is now Kohana 2.4 and has substantial
changes.
Diffstat (limited to 'system/helpers/upload.php')
-rw-r--r-- | system/helpers/upload.php | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/system/helpers/upload.php b/system/helpers/upload.php index 422e9e8d..3aec2ac4 100644 --- a/system/helpers/upload.php +++ b/system/helpers/upload.php @@ -3,12 +3,12 @@ * Upload helper class for working with the global $_FILES * array and Validation library. * - * $Id: upload.php 3769 2008-12-15 00:48:56Z zombor $ + * $Id: upload.php 4679 2009-11-10 01:45:52Z isaiah $ * * @package Core * @author Kohana Team - * @copyright (c) 2007-2008 Kohana Team - * @license http://kohanaphp.com/license.html + * @copyright (c) 2007-2009 Kohana Team + * @license http://kohanaphp.com/license */ class upload_Core { @@ -54,7 +54,7 @@ class upload_Core { } if ( ! is_writable($directory)) - throw new Kohana_Exception('upload.not_writable', $directory); + throw new Kohana_Exception('The upload destination folder, :dir:, does not appear to be writable.', array(':dir:' => $directory)); if (is_uploaded_file($file['tmp_name']) AND move_uploaded_file($file['tmp_name'], $filename = $directory.$filename)) { @@ -118,11 +118,8 @@ class upload_Core { // Get the default extension of the file $extension = strtolower(substr(strrchr($file['name'], '.'), 1)); - // Get the mime types for the extension - $mime_types = Kohana::config('mimes.'.$extension); - - // Make sure there is an extension, that the extension is allowed, and that mime types exist - return ( ! empty($extension) AND in_array($extension, $allowed_types) AND is_array($mime_types)); + // Make sure there is an extension and that the extension is allowed + return ( ! empty($extension) AND in_array($extension, $allowed_types)); } /** |