1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-12 19:54:12 +02:00

[ticket/16705] Fix check_disk_space function

PHPBB3-16705
This commit is contained in:
3D-I
2021-02-09 23:43:15 +01:00
parent 0daf4b6b1c
commit 91a5a73dca
2 changed files with 14 additions and 1 deletions

View File

@@ -296,8 +296,10 @@ class upload
*/
protected function check_disk_space()
{
if ($free_space = @disk_free_space($this->phpbb_root_path . $this->config['upload_path']))
if (function_exists('disk_free_space'))
{
$free_space = disk_free_space($this->phpbb_root_path);
if ($free_space <= $this->file->get('filesize'))
{
if ($this->auth->acl_get('a_'))
@@ -315,6 +317,16 @@ class upload
return false;
}
}
else
{
$this->file_data['error'][] = $this->language->lang('ATTACH_DISK_FREE_SPACE');
$this->file_data['post_attach'] = false;
$this->file->remove();
return false;
}
return true;
}