mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00: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
1 changed files with 9 additions and 8 deletions
|
@ -313,12 +313,9 @@ class filespec
|
||||||
if (!@move_uploaded_file($this->filename, $this->destination_file))
|
if (!@move_uploaded_file($this->filename, $this->destination_file))
|
||||||
{
|
{
|
||||||
$this->error[] = sprintf($user->lang[$this->upload->error_prefix . 'GENERAL_UPLOAD_ERROR'], $this->destination_file);
|
$this->error[] = sprintf($user->lang[$this->upload->error_prefix . 'GENERAL_UPLOAD_ERROR'], $this->destination_file);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@unlink($this->filename);
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'move':
|
case 'move':
|
||||||
|
@ -328,12 +325,9 @@ class filespec
|
||||||
if (!@copy($this->filename, $this->destination_file))
|
if (!@copy($this->filename, $this->destination_file))
|
||||||
{
|
{
|
||||||
$this->error[] = sprintf($user->lang[$this->upload->error_prefix . 'GENERAL_UPLOAD_ERROR'], $this->destination_file);
|
$this->error[] = sprintf($user->lang[$this->upload->error_prefix . 'GENERAL_UPLOAD_ERROR'], $this->destination_file);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@unlink($this->filename);
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'local':
|
case 'local':
|
||||||
|
@ -341,14 +335,21 @@ class filespec
|
||||||
if (!@copy($this->filename, $this->destination_file))
|
if (!@copy($this->filename, $this->destination_file))
|
||||||
{
|
{
|
||||||
$this->error[] = sprintf($user->lang[$this->upload->error_prefix . 'GENERAL_UPLOAD_ERROR'], $this->destination_file);
|
$this->error[] = sprintf($user->lang[$this->upload->error_prefix . 'GENERAL_UPLOAD_ERROR'], $this->destination_file);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
@unlink($this->filename);
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Remove temporary filename
|
||||||
|
@unlink($this->filename);
|
||||||
|
|
||||||
|
if (sizeof($this->error))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
phpbb_chmod($this->destination_file, $chmod);
|
phpbb_chmod($this->destination_file, $chmod);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Try to get real filesize from destination folder
|
// Try to get real filesize from destination folder
|
||||||
|
|
Loading…
Add table
Reference in a new issue