]> source.dussan.org Git - nextcloud-server.git/commitdiff
add a check for disk_free_space in Config.php 37159/head
authorSimon L <szaimen@e.mail.de>
Tue, 7 Mar 2023 08:51:00 +0000 (09:51 +0100)
committerbackportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com>
Thu, 9 Mar 2023 23:24:41 +0000 (23:24 +0000)
Signed-off-by: Simon L <szaimen@e.mail.de>
lib/private/Config.php

index 7e9684dda91c014f1d136aa07ea3ab54bcee84c9..3da055c9f9856769bafd1874559f41507894f3a6 100644 (file)
@@ -278,10 +278,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