From 207d618c22f6e50cf1dff983791282afe9f267ce Mon Sep 17 00:00:00 2001
From: Thomas Bruederli <thomas@roundcube.net>
Date: Thu, 14 Jun 2012 04:59:12 -0400
Subject: [PATCH] Merge branch 'master' of github.com:roundcube/roundcubemail
---
program/include/rcmail.php | 32 +++++++++++++++++++++++++++++---
1 files changed, 29 insertions(+), 3 deletions(-)
diff --git a/program/include/rcmail.php b/program/include/rcmail.php
index 4dba0e1..8ec8cfe 100644
--- a/program/include/rcmail.php
+++ b/program/include/rcmail.php
@@ -546,15 +546,16 @@
if (is_array($default_host)) {
$post_host = rcube_utils::get_input_value('_host', rcube_utils::INPUT_POST);
+ $post_user = rcube_utils::get_input_value('_user', rcube_utils::INPUT_POST);
+
+ list($user, $domain) = explode('@', $post_user);
// direct match in default_host array
if ($default_host[$post_host] || in_array($post_host, array_values($default_host))) {
$host = $post_host;
}
-
// try to select host by mail domain
- list($user, $domain) = explode('@', rcube_utils::get_input_value('_user', rcube_utils::INPUT_POST));
- if (!empty($domain)) {
+ else if (!empty($domain)) {
foreach ($default_host as $storage_host => $mail_domains) {
if (is_array($mail_domains) && in_array_nocase($domain, $mail_domains)) {
$host = $storage_host;
@@ -1996,6 +1997,31 @@
}
+ /**
+ * Returns real size (calculated) of the message part
+ *
+ * @param rcube_message_part Message part
+ *
+ * @return string Part size (and unit)
+ */
+ public function message_part_size($part)
+ {
+ if (isset($part->d_parameters['size'])) {
+ $size = $this->show_bytes((int)$part->d_parameters['size']);
+ }
+ else {
+ $size = $part->size;
+ if ($part->encoding == 'base64') {
+ $size = $size / 1.33;
+ }
+
+ $size = '~' . $this->show_bytes($size);
+ }
+
+ return $size;
+ }
+
+
/************************************************************************
********* Deprecated methods (to be removed) *********
***********************************************************************/
--
Gitblit v1.9.1