From af7e3662b834ac41131467464b5952627a36d6a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Calvo?= Date: Tue, 10 Jul 2018 06:59:52 +0200 Subject: [PATCH] [ticket/15342] Catch exception in check_disk_space PHPBB3-15342 --- phpBB/phpbb/attachment/upload.php | 34 +++++++++++++++++++------------ 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/phpBB/phpbb/attachment/upload.php b/phpBB/phpbb/attachment/upload.php index 3fa6544353..6202798e05 100644 --- a/phpBB/phpbb/attachment/upload.php +++ b/phpBB/phpbb/attachment/upload.php @@ -336,21 +336,29 @@ class upload */ protected function check_disk_space() { - $free_space = $this->storage->free_space(); - - if ($free_space !== false && $free_space <= $this->file->get('filesize')) + try { - 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; + $free_space = $this->storage->free_space(); - return false; + if ($free_space <= $this->file->get('filesize')) + { + 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; + } + } + catch (\phpbb\storage\exception\exception $e) + { + // Do nothing } return true;