1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-02-21 09:52:26 +01:00

[ticket/11226] Explicity set file_moved to false

PHPBB3-11226
This commit is contained in:
Tristan Darricau 2014-05-28 22:34:10 +02:00
parent 6a3b343dfc
commit b75fb96bab
2 changed files with 3 additions and 1 deletions

View File

@ -309,6 +309,7 @@ class filespec
{
@unlink($this->filename);
$this->error[] = $user->lang($this->upload->error_prefix . 'GENERAL_UPLOAD_ERROR', $this->destination_file);
$this->file_moved = false;
return false;
}
else

View File

@ -110,7 +110,8 @@ class phpbb_fileupload_test extends phpbb_test_case
copy($this->path . 'jpg', $this->path . 'jpg.jpg');
$file = $upload->local_upload($this->path . 'jpg.jpg');
$this->assertEquals(0, sizeof($file->error));
$file->move_file('../tests/upload/fixture');
$this->assertFalse($file->move_file('../tests/upload/fixture'));
$this->assertFalse($file->file_moved);
$this->assertEquals(1, sizeof($file->error));
}