summaryrefslogtreecommitdiff
path: root/program/include
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2012-05-26 20:38:50 +0200
committerAleksander Machniak <alec@alec.pl>2012-05-26 20:38:50 +0200
commit45dd7c122d489f63f6732286e9b238b2abd50f1d (patch)
tree90d57aad617fefaa19c3a2cdd41c5392306eb18f /program/include
parent089e53c61752fa1fd262a0055eff47bc21dac1eb (diff)
Fix host autoselection when default_host is an array (#1488495)
Diffstat (limited to 'program/include')
-rw-r--r--program/include/rcmail.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/program/include/rcmail.php b/program/include/rcmail.php
index 4dba0e1cf..a10a2aa72 100644
--- a/program/include/rcmail.php
+++ b/program/include/rcmail.php
@@ -546,15 +546,16 @@ class rcmail extends rcube
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;