mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-04 07:47:34 +02:00
[ticket/15342] Fix check_disk_space
PHPBB3-15342
This commit is contained in:
@@ -336,28 +336,21 @@ class upload
|
|||||||
*/
|
*/
|
||||||
protected function check_disk_space()
|
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');
|
||||||
{
|
|
||||||
$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;
|
|
||||||
}
|
}
|
||||||
}
|
else
|
||||||
catch (\phpbb\storage\exception\exception $e)
|
{
|
||||||
{
|
$this->file_data['error'][] = $this->language->lang('ATTACH_QUOTA_REACHED');
|
||||||
// Nothing
|
}
|
||||||
|
$this->file_data['post_attach'] = false;
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
Reference in New Issue
Block a user