Fix #32964 - default value must be very high
This commit is contained in:
parent
b6ab2b11d3
commit
fa0cc41f81
2 changed files with 3 additions and 4 deletions
|
|
@ -114,7 +114,7 @@ function getURLContent($url, $postorget = 'GET', $param = '', $followlocation =
|
|||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, getDolGlobalInt('MAIN_USE_CONNECT_TIMEOUT', 5));
|
||||
curl_setopt($ch, CURLOPT_TIMEOUT, getDolGlobalInt('MAIN_USE_RESPONSE_TIMEOUT', 30));
|
||||
|
||||
// limit size of downloaded files. TODO Add MAIN_SECURITY_MAXFILESIZE_DOWNLOADED
|
||||
// limit size of downloaded files.
|
||||
$maxsize = getDolGlobalInt('MAIN_SECURITY_MAXFILESIZE_DOWNLOADED');
|
||||
if ($maxsize && defined('CURLOPT_MAXFILESIZE_LARGE')) {
|
||||
curl_setopt($ch, CURLOPT_MAXFILESIZE_LARGE, $maxsize); // @phan-suppress-current-line PhanTypeMismatchArgumentNullableInternal
|
||||
|
|
|
|||
|
|
@ -213,9 +213,8 @@ class DocumentController extends Controller
|
|||
}
|
||||
|
||||
$fileSize = dol_filesize($fullpath_original_file);
|
||||
$fileSizeMaxDefault = 20 * 1024; // 20 Mo by default
|
||||
$fileSizeMax = getDolGlobalInt('MAIN_SECURITY_MAXFILESIZE_DOWNLOADED', $fileSizeMaxDefault);
|
||||
if ($fileSize > $fileSizeMax) {
|
||||
$fileSizeMax = getDolGlobalInt('MAIN_SECURITY_MAXFILESIZE_DOWNLOADED');
|
||||
if ($fileSizeMax && $fileSize > $fileSizeMax) {
|
||||
dol_syslog('ErrorFileSizeTooLarge: ' . $fileSize);
|
||||
print 'ErrorFileSizeTooLarge: ' . $fileSize . ' (max ' . $fileSizeMax . ')';
|
||||
exit;
|
||||
|
|
|
|||
Loading…
Reference in a new issue