Aleksander Machniak
2012-05-26 45dd7c122d489f63f6732286e9b238b2abd50f1d
Fix host autoselection when default_host is an array (#1488495)
2 files modified
8 ■■■■■ changed files
CHANGELOG 1 ●●●● patch | view | raw | blame | history
program/include/rcmail.php 7 ●●●●● patch | view | raw | blame | history
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
- Add is_escaped attribute for html_select and html_textarea (#1488485)
- Fix HTML entities handling in HTML editor (#1488483)
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;