summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authoracsfer <12234510+acsfer@users.noreply.github.com>2022-01-11 18:56:27 +0100
committerbackportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com>2022-10-10 19:08:34 +0000
commitad311c3bab82d0b7c21473a915cf38a780902dff (patch)
treeb334b88b5d94d980eb367b5cde3669968f491679 /apps
parentae8e433b4e66e6afbca1a2fb63111a2a996f2d4a (diff)
downloadnextcloud-server-ad311c3bab82d0b7c21473a915cf38a780902dff.tar.gz
nextcloud-server-ad311c3bab82d0b7c21473a915cf38a780902dff.zip
Harden some PHP functions
To avoid things like https://github.com/nextcloud/server/issues/26034 Signed-off-by: Louis Chemineau <louis@chmn.me>
Diffstat (limited to 'apps')
-rw-r--r--apps/settings/lib/Controller/CheckSetupController.php10
1 files changed, 5 insertions, 5 deletions
diff --git a/apps/settings/lib/Controller/CheckSetupController.php b/apps/settings/lib/Controller/CheckSetupController.php
index 3ade240943c..094753255b1 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;
}
@@ -811,12 +811,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;
}