mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-10 05:18:52 +00:00
[ticket/15342] Catch exception in check_disk_space
PHPBB3-15342
This commit is contained in:
parent
e5d8b1600b
commit
af7e3662b8
1 changed files with 21 additions and 13 deletions
|
@ -336,21 +336,29 @@ class upload
|
||||||
*/
|
*/
|
||||||
protected function check_disk_space()
|
protected function check_disk_space()
|
||||||
{
|
{
|
||||||
$free_space = $this->storage->free_space();
|
try
|
||||||
|
|
||||||
if ($free_space !== false && $free_space <= $this->file->get('filesize'))
|
|
||||||
{
|
{
|
||||||
if ($this->auth->acl_get('a_'))
|
$free_space = $this->storage->free_space();
|
||||||
{
|
|
||||||
$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;
|
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;
|
return true;
|
||||||
|
|
Loading…
Add table
Reference in a new issue