From: Simon L Date: Tue, 7 Mar 2023 08:51:00 +0000 (+0100) Subject: add a check for disk_free_space in Config.php X-Git-Tag: v27.0.0beta1~358^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=e87d968c2445bd510dedee76a0dd531b50943a7a;p=nextcloud-server.git add a check for disk_free_space in Config.php Signed-off-by: Simon L --- diff --git a/lib/private/Config.php b/lib/private/Config.php index a9ecaf2c825..3ea822101df 100644 --- a/lib/private/Config.php +++ b/lib/private/Config.php @@ -286,10 +286,12 @@ class Config { } // Never write file back if disk space should be too low - $df = disk_free_space($this->configDir); - $size = strlen($content) + 10240; - if ($df !== false && $df < (float)$size) { - throw new \Exception($this->configDir . " does not have enough space for writing the config file! Not writing it back!"); + if (function_exists('disk_free_space')) { + $df = disk_free_space($this->configDir); + $size = strlen($content) + 10240; + if ($df !== false && $df < (float)$size) { + throw new \Exception($this->configDir . " does not have enough space for writing the config file! Not writing it back!"); + } } // Try to acquire a file lock