From abc4a428dc4e0be2e302132072c16f29f8aca234 Mon Sep 17 00:00:00 2001 From: tokul Date: Sun, 29 Jan 2006 11:18:22 +0000 Subject: [PATCH] ipv6 address must be in [] git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@10607 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/imap_general.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/functions/imap_general.php b/functions/imap_general.php index 4a85407b..714946a2 100755 --- a/functions/imap_general.php +++ b/functions/imap_general.php @@ -636,7 +636,10 @@ function sqimap_read_data ($imap_stream, $tag_uid, $handle_errors, function sqimap_create_stream($server,$port,$tls=0) { global $squirrelmail_language; - // FIXME: ipv6 address support + if (strstr($server,':') && ! preg_match("/^\[.*\]$/",$server)) { + // numerical IPv6 address must be enclosed in square brackets + $server = '['.$server.']'; + } if ($tls == 1) { if ((check_php_version(4,3)) and (extension_loaded('openssl'))) { @@ -649,7 +652,7 @@ function sqimap_create_stream($server,$port,$tls=0) { _("TLS is enabled, but this version of PHP does not support TLS sockets, or is missing the openssl extension."). '

'. _("Please contact your system administrator and report this error."), - sprintf(_("Error connecting to IMAP server: %s."), $server)); + sprintf(_("Error connecting to IMAP server: %s."), $server)); } } @@ -661,7 +664,7 @@ function sqimap_create_stream($server,$port,$tls=0) { require_once(SM_PATH . 'functions/display_messages.php'); logout_error( sprintf(_("Error connecting to IMAP server: %s."), $server). "
\r\n$error_number : $error_string
\r\n", - sprintf(_("Error connecting to IMAP server: %s."), $server) ); + sprintf(_("Error connecting to IMAP server: %s."), $server) ); exit; } $server_info = fgets ($imap_stream, 1024); -- 2.25.1