diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2009-12-26 11:24:50 -0800 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2009-12-26 11:24:50 -0800 |
commit | 3060a6f662da66008d57a461bf1c9b5b4aa2b002 (patch) | |
tree | 442fd290505817efc0324f2af6e01805cb7396aa /system/helpers/upload.php | |
parent | 1cd6a615bb47a33794e4a4f690c87a348ab752d7 (diff) | |
parent | 32d25dafd5b033338b6a9bb8c7c53edab462543a (diff) |
Merge branch 'master' into talmdal_dev
Conflicts:
modules/gallery/controllers/albums.php
modules/gallery/controllers/movies.php
modules/gallery/controllers/photos.php
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)); } /** |