summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2012-05-26 20:40:47 +0200
committerAleksander Machniak <alec@alec.pl>2012-05-26 20:40:47 +0200
commita9055c5a81b3c7552c2cfa909ccd399c50f42b76 (patch)
treec1bd997864a0b34201a03372ba7b0cbd3c79ebbd
parentad8552ea6ffc656fb65480290d00f0572bc1fcd0 (diff)
Fix host autoselection when default_host is an array (#1488495)
-rw-r--r--CHANGELOG1
-rw-r--r--program/include/rcmail.php9
2 files changed, 6 insertions, 4 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 330e90c52..23d5694c4 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,7 @@
CHANGELOG Roundcube Webmail
===========================
+- Fix host autoselection when default_host is an array (#1488495)
- Move messages forwarding mode setting into Preferences
- Fix HTML entities handling in HTML editor (#1488483)
- Fix listing shared folders on Courier IMAP (#1488466)
diff --git a/program/include/rcmail.php b/program/include/rcmail.php
index c0defa6d4..66e9a5c06 100644
--- a/program/include/rcmail.php
+++ b/program/include/rcmail.php
@@ -1017,15 +1017,16 @@ class rcmail
if (is_array($default_host)) {
$post_host = get_input_value('_host', RCUBE_INPUT_POST);
+ $post_user = get_input_value('_user', RCUBE_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))) {
+ if ($default_host[$post_host] || in_array($post_host, $default_host)) {
$host = $post_host;
}
-
// try to select host by mail domain
- list($user, $domain) = explode('@', get_input_value('_user', RCUBE_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;