diff options
| author | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2012-01-25 08:18:30 +0000 |
|---|---|---|
| committer | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2012-01-25 08:18:30 +0000 |
| commit | a9ae587284fd1df155579e4368cbfc66d40f93c8 (patch) | |
| tree | 946fb467318ab8516b99e31b704934635428c80b /roundcubemail | |
| parent | 1c2d50422ada20605f7a6f027205f95349f3bbe0 (diff) | |
Fix autoselect_host() for login (#1488297)
git-svn-id: https://svn.roundcube.net/trunk@5819 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail')
| -rw-r--r-- | roundcubemail/CHANGELOG | 1 | ||||
| -rw-r--r-- | roundcubemail/program/include/rcmail.php | 11 |
2 files changed, 9 insertions, 3 deletions
diff --git a/roundcubemail/CHANGELOG b/roundcubemail/CHANGELOG index 35d13ba31..39d1a5b59 100644 --- a/roundcubemail/CHANGELOG +++ b/roundcubemail/CHANGELOG @@ -1,6 +1,7 @@ CHANGELOG Roundcube Webmail =========================== +- Fix autoselect_host() for login (#1488297) - Fix drafts update issues when edited from preview pane (#1488314) - Changed license to GNU GPLv3+ with exceptions for skins & plugins - Make mime type detection based on filename extension to be case-insensitive diff --git a/roundcubemail/program/include/rcmail.php b/roundcubemail/program/include/rcmail.php index 65877378f..5965099c9 100644 --- a/roundcubemail/program/include/rcmail.php +++ b/roundcubemail/program/include/rcmail.php @@ -1020,16 +1020,21 @@ class rcmail list($user, $domain) = explode('@', get_input_value('_user', RCUBE_INPUT_POST)); if (!empty($domain)) { foreach ($default_host as $storage_host => $mail_domains) { - if (is_array($mail_domains) && in_array($domain, $mail_domains)) { + if (is_array($mail_domains) && in_array_nocase($domain, $mail_domains)) { $host = $storage_host; break; } + else if (stripos($storage_host, $domain) !== false || stripos(strval($mail_domains), $domain) !== false) { + $host = is_numeric($storage_host) ? $mail_domains : $storage_host; + break; + } } } - // take the first entry if $host is still an array + // take the first entry if $host is still not set if (empty($host)) { - $host = array_shift($default_host); + list($key, $val) = each($default_host); + $host = is_numeric($key) ? $val : $key; } } else if (empty($default_host)) { |
