diff --git a/phpBB/phpbb/attachment/upload.php b/phpBB/phpbb/attachment/upload.php index 1f3c8c762e..3fa6544353 100644 --- a/phpBB/phpbb/attachment/upload.php +++ b/phpBB/phpbb/attachment/upload.php @@ -336,28 +336,21 @@ class upload */ protected function check_disk_space() { - try - { - $free_space = $this->storage->free_space(); + $free_space = $this->storage->free_space(); - if ($free_space <= $this->file->get('filesize')) + if ($free_space !== false && $free_space <= $this->file->get('filesize')) + { + if ($this->auth->acl_get('a_')) { - if ($this->auth->acl_get('a_')) - { - $this->file_data['error'][] = $this->language->lang('ATTACH_DISK_FULL'); - } - else - { - $this->file_data['error'][] = $this->language->lang('ATTACH_QUOTA_REACHED'); - } - $this->file_data['post_attach'] = false; - - return false; + $this->file_data['error'][] = $this->language->lang('ATTACH_DISK_FULL'); } - } - catch (\phpbb\storage\exception\exception $e) - { - // Nothing + else + { + $this->file_data['error'][] = $this->language->lang('ATTACH_QUOTA_REACHED'); + } + $this->file_data['post_attach'] = false; + + return false; } return true;