Fix so displayed maximum attachment size depends also on 'max_message_size' (#7105)

pull/7135/head
Aleksander Machniak 5 years ago
parent 0b45c3c6b0
commit a5b15da155

@ -22,6 +22,7 @@ CHANGELOG Roundcube Webmail
- Fix bug where cancelling switching from HTML to plain text didn't set the flag properly (#7077)
- Fix bug where HTML reply could add an empty line with extra indentation above the original message (#7088)
- Fix matching multiple X-Forwarded-For addresses with 'proxy_whitelist' (#7107)
- Fix so displayed maximum attachment size depends also on 'max_message_size' (#7105)
RELEASE 1.4.1
-------------

@ -2160,13 +2160,14 @@ class rcmail extends rcube
* @param string $name Form object name
* @param string $action Form action name
* @param array $input_attr File input attributes
* @param int $max_size Maximum upload size
*
* @return string HTML output
*/
public function upload_form($attrib, $name, $action, $input_attr = array())
public function upload_form($attrib, $name, $action, $input_attr = array(), $max_size = null)
{
// Get filesize, enable upload progress bar
$max_filesize = $this->upload_init();
$max_filesize = $this->upload_init($max_size);
$hint = html::div('hint', $this->gettext(array('name' => 'maxuploadsize', 'vars' => array('size' => $max_filesize))));

@ -1282,7 +1282,10 @@ function rcmail_compose_attachment_form($attrib)
{
global $RCMAIL;
return $RCMAIL->upload_form($attrib, 'uploadform', 'send-attachment', array('multiple' => true));
// Limit attachment size according to message size limit
$limit = parse_bytes($RCMAIL->config->get('max_message_size')) / 1.33;
return $RCMAIL->upload_form($attrib, 'uploadform', 'send-attachment', array('multiple' => true), $limit);
}
/**

Loading…
Cancel
Save