mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-13 21:26:28 +02: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:
@ -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
|
||||||
|
Reference in New Issue
Block a user