Browse Source

Check for `disk_free_space`

Check for `disk_free_space` before calling it.
Fix https://github.com/nextcloud/server/issues/29748
pull/29758/head
acsfer 4 years ago
committed by GitHub
parent
commit
152e2bfdaa
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      lib/private/Files/Storage/Local.php

2
lib/private/Files/Storage/Local.php

@ -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;
}

Loading…
Cancel
Save