Fix free space problems

Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
This commit is contained in:
Git'Fellow 2023-03-07 00:13:57 +01:00 committed by Robin Appelman
parent b40e943076
commit 2ef8e76adb
No known key found for this signature in database
GPG key ID: 42B69D8A64526EFB

View file

@ -418,7 +418,7 @@ class Local extends \OC\Files\Storage\Common {
// disk_free_space doesn't work on files
$sourcePath = dirname($sourcePath);
}
$space = function_exists('disk_free_space') ? disk_free_space($sourcePath) : false;
$space = is_dir($sourcePath) ? disk_free_space($sourcePath) : false;
if ($space === false || is_null($space)) {
return \OCP\Files\FileInfo::SPACE_UNKNOWN;
}