diff options
author | Simon L <szaimen@e.mail.de> | 2023-03-09 10:24:20 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-09 10:24:20 +0100 |
commit | 694f7438292acc039290a4e5db1e1be326f7d4e4 (patch) | |
tree | fe0eff71d19d5e3b7d182a2fab804c1e4e3c46a0 /lib/private | |
parent | 3dbe10856815aa2aa78797eb7d82440ed67a3e32 (diff) | |
parent | e87d968c2445bd510dedee76a0dd531b50943a7a (diff) | |
download | nextcloud-server-694f7438292acc039290a4e5db1e1be326f7d4e4.tar.gz nextcloud-server-694f7438292acc039290a4e5db1e1be326f7d4e4.zip |
Merge pull request #37070 from nextcloud/enh/noid/add-free-disk-space-check
add a check for disk_free_space in Config.php
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/Config.php | 10 |
1 files changed, 6 insertions, 4 deletions
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 |