summaryrefslogtreecommitdiffstats
path: root/system/libraries/Upload.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2015-07-09 14:14:35 +0200
committerAndrey Andreev <narf@devilix.net>2015-07-09 14:14:35 +0200
commit91da5d1cc0f339f94922e48bdcce1bace602713a (patch)
tree407ecd5cc559feee852a3a2b39d06e5e470ef39e /system/libraries/Upload.php
parenta45e37e235da97f539548b457ef4ae46d55ce77e (diff)
Fix #3965
Diffstat (limited to 'system/libraries/Upload.php')
-rw-r--r--system/libraries/Upload.php12
1 files changed, 3 insertions, 9 deletions
diff --git a/system/libraries/Upload.php b/system/libraries/Upload.php
index a1bd14930..51232f8a7 100644
--- a/system/libraries/Upload.php
+++ b/system/libraries/Upload.php
@@ -533,15 +533,9 @@ class CI_Upload {
* If it returns false there was a problem.
*/
$this->orig_name = $this->file_name;
-
- if ($this->overwrite === FALSE)
+ if (FALSE === ($this->file_name = $this->set_filename($this->upload_path, $this->file_name)))
{
- $this->file_name = $this->set_filename($this->upload_path, $this->file_name);
-
- if ($this->file_name === FALSE)
- {
- return FALSE;
- }
+ return FALSE;
}
/*
@@ -656,7 +650,7 @@ class CI_Upload {
$filename = md5(uniqid(mt_rand())).$this->file_ext;
}
- if ( ! file_exists($path.$filename))
+ if ($this->overwrite === TRUE OR ! file_exists($path.$filename))
{
return $filename;
}