[ticket/15342] Catch exception in check_disk_space

PHPBB3-15342
This commit is contained in:
Rubén Calvo 2018-07-10 06:59:52 +02:00
parent e5d8b1600b
commit af7e3662b8

View file

@ -335,10 +335,12 @@ class upload
* @return bool True if disk space is available or not limited, false if not
*/
protected function check_disk_space()
{
try
{
$free_space = $this->storage->free_space();
if ($free_space !== false && $free_space <= $this->file->get('filesize'))
if ($free_space <= $this->file->get('filesize'))
{
if ($this->auth->acl_get('a_'))
{
@ -348,10 +350,16 @@ class upload
{
$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;
}