diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2009-09-08 14:02:40 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2009-09-08 14:02:40 +0000 |
commit | a5e4ca259aa98bc3d5abc03dcf4504c2afe91e92 (patch) | |
tree | 62ffd1fa476a499319ce31047154545aab7f0ac3 /phpBB/includes | |
parent | 5537393f76cf56d21f39b863425f3ddb5c500808 (diff) | |
download | forums-a5e4ca259aa98bc3d5abc03dcf4504c2afe91e92.tar forums-a5e4ca259aa98bc3d5abc03dcf4504c2afe91e92.tar.gz forums-a5e4ca259aa98bc3d5abc03dcf4504c2afe91e92.tar.bz2 forums-a5e4ca259aa98bc3d5abc03dcf4504c2afe91e92.tar.xz forums-a5e4ca259aa98bc3d5abc03dcf4504c2afe91e92.zip |
Always remove temporary filename (Bug #50965)
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10122 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes')
-rw-r--r-- | phpBB/includes/functions_upload.php | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/phpBB/includes/functions_upload.php b/phpBB/includes/functions_upload.php index 40ff4de2d1..a7abb06674 100644 --- a/phpBB/includes/functions_upload.php +++ b/phpBB/includes/functions_upload.php @@ -313,12 +313,9 @@ class filespec if (!@move_uploaded_file($this->filename, $this->destination_file)) { $this->error[] = sprintf($user->lang[$this->upload->error_prefix . 'GENERAL_UPLOAD_ERROR'], $this->destination_file); - return false; } } - @unlink($this->filename); - break; case 'move': @@ -328,12 +325,9 @@ class filespec if (!@copy($this->filename, $this->destination_file)) { $this->error[] = sprintf($user->lang[$this->upload->error_prefix . 'GENERAL_UPLOAD_ERROR'], $this->destination_file); - return false; } } - @unlink($this->filename); - break; case 'local': @@ -341,14 +335,21 @@ class filespec if (!@copy($this->filename, $this->destination_file)) { $this->error[] = sprintf($user->lang[$this->upload->error_prefix . 'GENERAL_UPLOAD_ERROR'], $this->destination_file); - return false; } - @unlink($this->filename); break; } + // Remove temporary filename + @unlink($this->filename); + + if (sizeof($this->error)) + { + return false; + } + phpbb_chmod($this->destination_file, $chmod); + return true; } // Try to get real filesize from destination folder |