Skip to content

Commit b6d5600

Browse files
authored
Merge pull request #34506 from nextcloud/backport/30608/stable24
[stable24] Harden disk_free_space check in CheckSetupController
2 parents ae8e433 + ad311c3 commit b6d5600

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

apps/settings/lib/Controller/CheckSetupController.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ private function isCorrectMemcachedPHPModuleInstalled() {
379379
return true;
380380
}
381381

382-
// there are two different memcached modules for PHP
382+
// there are two different memcache modules for PHP
383383
// we only support memcached and not memcache
384384
// https://code.google.com/p/memcached/wiki/PHPClientComparison
385385
return !(!extension_loaded('memcached') && extension_loaded('memcache'));
@@ -392,7 +392,7 @@ private function isCorrectMemcachedPHPModuleInstalled() {
392392
*/
393393
private function isSettimelimitAvailable() {
394394
if (function_exists('set_time_limit')
395-
&& strpos(@ini_get('disable_functions'), 'set_time_limit') === false) {
395+
&& strpos(ini_get('disable_functions'), 'set_time_limit') === false) {
396396
return true;
397397
}
398398

@@ -811,12 +811,12 @@ protected function isEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed(): bool {
811811

812812
$tempPath = sys_get_temp_dir();
813813
if (!is_dir($tempPath)) {
814-
$this->logger->error('Error while checking the temporary PHP path - it was not properly set to a directory. value: ' . $tempPath);
814+
$this->logger->error('Error while checking the temporary PHP path - it was not properly set to a directory. Returned value: ' . $tempPath);
815815
return false;
816816
}
817-
$freeSpaceInTemp = disk_free_space($tempPath);
817+
$freeSpaceInTemp = function_exists('disk_free_space') ? disk_free_space($tempPath) : false;
818818
if ($freeSpaceInTemp === false) {
819-
$this->logger->error('Error while checking the available disk space of temporary PHP path - no free disk space returned. temporary path: ' . $tempPath);
819+
$this->logger->error('Error while checking the available disk space of temporary PHP path or no free disk space returned. Temporary path: ' . $tempPath);
820820
return false;
821821
}
822822

0 commit comments

Comments
 (0)