Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/roundcube/roundcubemail.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2019-12-07 11:57:02 +0300
committerAleksander Machniak <alec@alec.pl>2019-12-07 11:57:02 +0300
commita5b15da155d6d48726ec224ba08a922c03eac753 (patch)
tree64bd5b467ddcde4021a4c3643b804cd787a72f99 /program
parent0b45c3c6b0b5c8f791f69c6a42411e433c3e9e8f (diff)
Fix so displayed maximum attachment size depends also on 'max_message_size' (#7105)
Diffstat (limited to 'program')
-rw-r--r--program/include/rcmail.php5
-rw-r--r--program/steps/mail/compose.inc5
2 files changed, 7 insertions, 3 deletions
diff --git a/program/include/rcmail.php b/program/include/rcmail.php
index e61b12f7e..535da2e09 100644
--- a/program/include/rcmail.php
+++ b/program/include/rcmail.php
@@ -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))));
diff --git a/program/steps/mail/compose.inc b/program/steps/mail/compose.inc
index 123bfda7f..ba87f71a4 100644
--- a/program/steps/mail/compose.inc
+++ b/program/steps/mail/compose.inc
@@ -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);
}
/**