aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMikael Nordin <mickenordin@users.noreply.github.com>2022-04-30 16:30:11 +0200
committerMicke Nordin <kano@sunet.se>2022-04-30 16:41:35 +0200
commit30fe91a77fc9c18f6cc6b0756a5dcf4c1304b5c3 (patch)
tree1dd13f0fa0e2fd0c2ce1af3725f5e2ebf60eaf6a /lib
parent259664468a009b03d6d974613e47f0e140f7332b (diff)
downloadnextcloud-server-30fe91a77fc9c18f6cc6b0756a5dcf4c1304b5c3.tar.gz
nextcloud-server-30fe91a77fc9c18f6cc6b0756a5dcf4c1304b5c3.zip
Simpler version as proposed by @artonage
Co-authored-by: Louis <6653109+artonge@users.noreply.github.com> Signed-off-by: Micke Nordin <kano@sunet.se>
Diffstat (limited to 'lib')
-rw-r--r--lib/base.php19
1 files changed, 5 insertions, 14 deletions
diff --git a/lib/base.php b/lib/base.php
index d73fa92abef..5695bbe06f9 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -627,27 +627,18 @@ class OC {
//try to configure php to enable big file uploads.
//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
- // One hour is 3600 seconds
- $time_limit = 3600;
- $max_execution_time_from_ini = @ini_get('max_execution_time');
- $biggest_max_execution_time = $time_limit;
- if (isset($max_execution_time_from_ini)) {
- $biggest_max_execution_time = max($time_limit, intval($max_execution_time_from_ini));
+ if (intval(@ini_get('max_execution_time')?? 0) < 3600) {
+ @ini_set('max_execution_time', strval(3600));
}
- @ini_set('max_execution_time', strval($biggest_max_execution_time));
- $max_input_time_from_ini = @ini_get('max_input_time');
- $biggest_max_input_time = $time_limit;
- if (isset($max_input_time_from_ini)) {
- $biggest_max_input_time = max($time_limit, intval($max_input_time_from_ini));
+ if (intval(@ini_get('max_input_time')?? 0) < 3600) {
+ @ini_set('max_input_time', strval(3600));
}
- @ini_set('max_input_time', strval($biggest_max_input_time));
//try to set the maximum execution time to the largest time limit we have
if (strpos(@ini_get('disable_functions'), 'set_time_limit') === false) {
- $biggest_time_limit = max($time_limit, $biggest_max_execution_time, $biggest_max_input_time);
- @set_time_limit($biggest_time_limit);
+ @set_time_limit(strval(max(intval(@ini_get('max_execution_time')),intval(@ini_get('max_input_time')))));
}
self::setRequiredIniValues();