diff options
author | Louis <6653109+artonge@users.noreply.github.com> | 2022-05-17 10:14:56 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-17 10:14:56 +0200 |
commit | 8ed92ad4f7c9ddbca1ea3b50e4ed5dcbcf64a6d4 (patch) | |
tree | 61af79c971f3cdbb00a4436492c52a7a16475013 /lib/base.php | |
parent | 9e18a3be2df17a2c10fb3325cc763828428f00c2 (diff) | |
parent | 0ace1831f48be9f324635fba0d2817291a89d037 (diff) | |
download | nextcloud-server-8ed92ad4f7c9ddbca1ea3b50e4ed5dcbcf64a6d4.tar.gz nextcloud-server-8ed92ad4f7c9ddbca1ea3b50e4ed5dcbcf64a6d4.zip |
Merge pull request #32216 from SUNET/master
Respect user settings in php.ini if they are big enough
Diffstat (limited to 'lib/base.php')
-rw-r--r-- | lib/base.php | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/lib/base.php b/lib/base.php index 377644c70a2..212bd01477c 100644 --- a/lib/base.php +++ b/lib/base.php @@ -615,16 +615,23 @@ class OC { throw new \RuntimeException('Could not set timezone to UTC'); } + //try to configure php to enable big file uploads. - //this doesn´t work always depending on the web server and php configuration. - //Let´s try to overwrite some defaults anyway + //this doesn´t work always depending on the webserver and php configuration. + //Let´s try to overwrite some defaults if they are smaller than 1 hour + + if (intval(@ini_get('max_execution_time') ?? 0) < 3600) { + @ini_set('max_execution_time', strval(3600)); + } + + if (intval(@ini_get('max_input_time') ?? 0) < 3600) { + @ini_set('max_input_time', strval(3600)); + } - //try to set the maximum execution time to 60min + //try to set the maximum execution time to the largest time limit we have if (strpos(@ini_get('disable_functions'), 'set_time_limit') === false) { - @set_time_limit(3600); + @set_time_limit(max(intval(@ini_get('max_execution_time')), intval(@ini_get('max_input_time')))); } - @ini_set('max_execution_time', '3600'); - @ini_set('max_input_time', '3600'); self::handleAuthHeaders(); $systemConfig = \OC::$server->get(\OC\SystemConfig::class); |