diff options
author | Micke Nordin <kano@sunet.se> | 2022-04-29 08:21:53 +0200 |
---|---|---|
committer | backportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com> | 2022-08-22 22:00:24 +0000 |
commit | 4092599d15892f6f31dccfefb811b5966acaccc4 (patch) | |
tree | 67045c310b1ba0f6e13d096216cc0d3d4d9f177c | |
parent | a196df1b8eac095e1118e4dedf4556f777a3cfac (diff) | |
download | nextcloud-server-4092599d15892f6f31dccfefb811b5966acaccc4.tar.gz nextcloud-server-4092599d15892f6f31dccfefb811b5966acaccc4.zip |
Respect user settings in php.ini if they are big enough
In the admin guide:
* https://docs.nextcloud.com/server/latest/admin_manual/configuration_files/big_file_upload_configuration.html
it is mentioned that you can tweek:
* max_input_time
* max_execution_time
in order to enable larger file uploads. However, the current codebase
will hard code these values to one hour, no matter what the user sets in
php.ini.
This patch will allow the user to set these settings in php.ini and they
will be respected, if and only if, they are set to something bigger than
3600 seconds.
Signed-off-by: Micke Nordin <kano@sunet.se>
-rw-r--r-- | lib/base.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/base.php b/lib/base.php index c0b26e96851..9c0ab305f79 100644 --- a/lib/base.php +++ b/lib/base.php @@ -609,16 +609,16 @@ 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 webserver and php configuration. //Let´s try to overwrite some defaults anyway - //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); + $biggest_time_limit = max($time_limit, $biggest_max_execution_time, $biggest_max_input_time); + @set_time_limit($biggest_time_limit); } - @ini_set('max_execution_time', '3600'); - @ini_set('max_input_time', '3600'); self::setRequiredIniValues(); self::handleAuthHeaders(); |