summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorblizzz <blizzz@arthur-schiwon.de>2022-08-23 10:29:36 +0200
committerGitHub <noreply@github.com>2022-08-23 10:29:36 +0200
commitfcff68a5c21efb5a9930203e63d35b3be89f8818 (patch)
tree91b333f4da37ee9f7068fe726f81e5c5d3e492a0 /lib
parent1a92992fc06fdcde8d87e88ffadf9771defc654e (diff)
parent47fd27bc4c593ad336bbd898d168c62345e4b6f6 (diff)
downloadnextcloud-server-fcff68a5c21efb5a9930203e63d35b3be89f8818.tar.gz
nextcloud-server-fcff68a5c21efb5a9930203e63d35b3be89f8818.zip
Merge pull request #33644 from nextcloud/backport/32216/stable24
[stable24] Respect user settings in php.ini if they are big enough
Diffstat (limited to 'lib')
-rw-r--r--lib/base.php19
1 files changed, 13 insertions, 6 deletions
diff --git a/lib/base.php b/lib/base.php
index 66e57459a91..b601e4b19f2 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -623,16 +623,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::setRequiredIniValues();
self::handleAuthHeaders();