diff options
author | Louis <6653109+artonge@users.noreply.github.com> | 2022-10-10 15:42:49 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-10 15:42:49 +0200 |
commit | f456989261c7f0f42be832513cbc6a4f53d87cff (patch) | |
tree | 021f41c77ad3e965d33f819f696e3d2e07fde9c7 /apps | |
parent | 84f3f6eddd7359bbbd0ca7fc9489e7b3165996fa (diff) | |
parent | 4207b80141f762aa007a17b5e133db8ebdb81047 (diff) | |
download | nextcloud-server-f456989261c7f0f42be832513cbc6a4f53d87cff.tar.gz nextcloud-server-f456989261c7f0f42be832513cbc6a4f53d87cff.zip |
Merge pull request #30608 from nextcloud/harden-fonct
Harden disk_free_space check in CheckSetupController
Diffstat (limited to 'apps')
-rw-r--r-- | apps/settings/lib/Controller/CheckSetupController.php | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/apps/settings/lib/Controller/CheckSetupController.php b/apps/settings/lib/Controller/CheckSetupController.php index 0b3d63ac06d..dd401b045f0 100644 --- a/apps/settings/lib/Controller/CheckSetupController.php +++ b/apps/settings/lib/Controller/CheckSetupController.php @@ -379,7 +379,7 @@ class CheckSetupController extends Controller { return true; } - // there are two different memcached modules for PHP + // there are two different memcache modules for PHP // we only support memcached and not memcache // https://code.google.com/p/memcached/wiki/PHPClientComparison return !(!extension_loaded('memcached') && extension_loaded('memcache')); @@ -392,7 +392,7 @@ class CheckSetupController extends Controller { */ private function isSettimelimitAvailable() { if (function_exists('set_time_limit') - && strpos(@ini_get('disable_functions'), 'set_time_limit') === false) { + && strpos(ini_get('disable_functions'), 'set_time_limit') === false) { return true; } @@ -819,12 +819,12 @@ Raw output $tempPath = sys_get_temp_dir(); if (!is_dir($tempPath)) { - $this->logger->error('Error while checking the temporary PHP path - it was not properly set to a directory. value: ' . $tempPath); + $this->logger->error('Error while checking the temporary PHP path - it was not properly set to a directory. Returned value: ' . $tempPath); return false; } - $freeSpaceInTemp = disk_free_space($tempPath); + $freeSpaceInTemp = function_exists('disk_free_space') ? disk_free_space($tempPath) : false; if ($freeSpaceInTemp === false) { - $this->logger->error('Error while checking the available disk space of temporary PHP path - no free disk space returned. temporary path: ' . $tempPath); + $this->logger->error('Error while checking the available disk space of temporary PHP path or no free disk space returned. Temporary path: ' . $tempPath); return false; } |