Skip to content

Commit

Permalink
Merge pull request #6141 from 3D-I/ticket/16705
Browse files Browse the repository at this point in the history
[ticket/16705] Fix check_disk_space function - PHP 8
  • Loading branch information
marc1706 committed Mar 5, 2021
2 parents ae7f383 + 5d18ad6 commit b978fd9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion phpBB/phpbb/attachment/upload.php
Expand Up @@ -296,8 +296,10 @@ protected function check_attach_quota()
*/
protected function check_disk_space()
{
if ($free_space = @disk_free_space($this->phpbb_root_path . $this->config['upload_path']))
if (function_exists('disk_free_space'))
{
$free_space = @disk_free_space($this->phpbb_root_path);

if ($free_space <= $this->file->get('filesize'))
{
if ($this->auth->acl_get('a_'))
Expand Down
1 change: 1 addition & 0 deletions tests/attachment/upload_test.php
Expand Up @@ -79,6 +79,7 @@ protected function setUp(): void
'img_create_thumbnail' => true,
));
$config = $this->config;
$this->phpbb_root_path = $phpbb_root_path;
$this->db = $this->new_dbal();
$this->cache = new \phpbb\cache\service(new \phpbb\cache\driver\dummy(), $this->config, $this->db, $phpbb_root_path, $phpEx);
$this->request = $this->createMock('\phpbb\request\request');
Expand Down

0 comments on commit b978fd9

Please sign in to comment.