mirror of
https://github.com/phpbb/phpbb.git
synced 2025-02-24 12:03:21 +01:00
Always remove temporary filename (Bug #50965)
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10122 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
5537393f76
commit
a5e4ca259a
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user