summaryrefslogtreecommitdiffstats
path: root/system/libraries/Upload.php
diff options
context:
space:
mode:
authorPhil Sturgeon <email@philsturgeon.co.uk>2011-01-27 12:56:45 +0100
committerPhil Sturgeon <email@philsturgeon.co.uk>2011-01-27 12:56:45 +0100
commit3bb336cf1c55584bb92ed32563a9543ec7f01574 (patch)
tree76c2d963be0b7c70705369ca4a9f82946df8bba8 /system/libraries/Upload.php
parent7d3a1894be6b1722c668d73ce53533bb72cc237c (diff)
parent705a3eec44635f3fada8daa2886d409e6447ca12 (diff)
Automated merge with https://bitbucket.org/ellislab/codeigniter
Diffstat (limited to 'system/libraries/Upload.php')
-rw-r--r--system/libraries/Upload.php13
1 files changed, 12 insertions, 1 deletions
diff --git a/system/libraries/Upload.php b/system/libraries/Upload.php
index 4ccc032e9..8f84ffd7e 100644
--- a/system/libraries/Upload.php
+++ b/system/libraries/Upload.php
@@ -212,7 +212,18 @@ class CI_Upload {
if ($this->_file_name_override != '')
{
$this->file_name = $this->_prep_filename($this->_file_name_override);
- $this->file_ext = $this->get_extension($this->file_name);
+
+ // If no extension was provided in the file_name config item, use the uploaded one
+ if(strpos($this->_file_name_override, '.') === FALSE)
+ {
+ $this->file_name .= $this->file_ext;
+ }
+
+ // An extension was provided, lets have it!
+ else
+ {
+ $this->file_ext = $this->get_extension($this->_file_name_override);
+ }
if ( ! $this->is_allowed_filetype(TRUE))
{