From: Git'Fellow <12234510+solracsf@users.noreply.github.com> Date: Tue, 7 Mar 2023 16:09:24 +0000 (+0100) Subject: Add function_exists() check X-Git-Tag: v26.0.2rc1~36^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=refs%2Fpull%2F37873%2Fhead;p=nextcloud-server.git Add function_exists() check Co-authored-by: Simon L. Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com> --- diff --git a/lib/private/Files/Storage/Local.php b/lib/private/Files/Storage/Local.php index 30b581a863d..a375a544300 100644 --- a/lib/private/Files/Storage/Local.php +++ b/lib/private/Files/Storage/Local.php @@ -418,7 +418,7 @@ class Local extends \OC\Files\Storage\Common { // disk_free_space doesn't work on files $sourcePath = dirname($sourcePath); } - $space = is_dir($sourcePath) ? disk_free_space($sourcePath) : false; + $space = (function_exists('disk_free_space') && is_dir($sourcePath)) ? disk_free_space($sourcePath) : false; if ($space === false || is_null($space)) { return \OCP\Files\FileInfo::SPACE_UNKNOWN; }