mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-01-01 20:42:19 +08:00
Bugfix: default attachment_size_limit to PHP upload_max_filesize
This commit is contained in:
parent
1f2208d304
commit
d3d0180208
1 changed files with 10 additions and 1 deletions
|
@ -106,6 +106,15 @@ class Application extends \RainLoop\Config\AbstractConfig
|
|||
|
||||
protected function defaultValues() : array
|
||||
{
|
||||
$value = \ini_get('upload_max_filesize');
|
||||
$upload_max_filesize = \intval($value);
|
||||
switch (\strtoupper(\substr($value, -1))) {
|
||||
case 'G': $upload_max_filesize *= 1024;
|
||||
case 'M': $upload_max_filesize *= 1024;
|
||||
case 'K': $upload_max_filesize *= 1024;
|
||||
}
|
||||
$upload_max_filesize = $upload_max_filesize / 1024 / 1024;
|
||||
|
||||
return array(
|
||||
|
||||
'webmail' => array(
|
||||
|
@ -127,7 +136,7 @@ class Application extends \RainLoop\Config\AbstractConfig
|
|||
|
||||
'messages_per_page' => array(20, 'Number of messages displayed on page by default'),
|
||||
|
||||
'attachment_size_limit' => array(25, 'File size limit (MB) for file upload on compose screen
|
||||
'attachment_size_limit' => array(\min($upload_max_filesize, 25), 'File size limit (MB) for file upload on compose screen
|
||||
0 for unlimited.')
|
||||
),
|
||||
|
||||
|
|
Loading…
Reference in a new issue