Merge pull request #29758 from nextcloud/disk_free_space-fix-php8

Check for `disk_free_space`
This commit is contained in:
Vincent Petry 2021-11-19 17:14:08 +01:00 committed by GitHub
commit 289624b79e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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