X-Git-Url: https://git.donarmstrong.com/?p=roundcube.git;a=blobdiff_plain;f=installer%2Ftest.php;h=2dd330531e5c36837fa7ba06a8e199dedef8a15d;hp=02a1cebe27c40431971b7fa7dee54d6c81b9c1dd;hb=76507f7c63a660742e76889ad6e3919f3dde3bb0;hpb=a2dd2e41259a5e90016efcd7d083020b95e25527 diff --git a/installer/test.php b/installer/test.php index 02a1ceb..2dd3305 100644 --- a/installer/test.php +++ b/installer/test.php @@ -382,18 +382,20 @@ $pass_field = new html_passwordfield(array('name' => '_pass', 'id' => 'imappass' Connecting to ' . Q($_POST['_host']) . '...
'; - - $a_host = parse_url($_POST['_host']); + + $imap_host = trim($_POST['_host']); + $imap_port = $RCI->getprop('default_port'); + $a_host = parse_url($imap_host); + if ($a_host['host']) { $imap_host = $a_host['host']; - $imap_ssl = (isset($a_host['scheme']) && in_array($a_host['scheme'], array('ssl','imaps','tls'))) ? $a_host['scheme'] : null; - $imap_port = isset($a_host['port']) ? $a_host['port'] : ($imap_ssl ? 993 : $CONFIG['default_port']); - } - else { - $imap_host = trim($_POST['_host']); - $imap_port = $RCI->getprop('default_port'); + $imap_ssl = (isset($a_host['scheme']) && in_array($a_host['scheme'], array('ssl','imaps','tls'))) ? $a_host['scheme'] : null; + if (isset($a_host['port'])) + $imap_port = $a_host['port']; + else if ($imap_ssl && $imap_ssl != 'tls' && (!$imap_port || $imap_port == 143)) + $imap_port = 993; } $imap_host = idn_to_ascii($imap_host);