for FIREBIRD >= 3.0). (Dorin Marcoci)
. Fixed bug #76488 (Memory leak when fetching a BLOB field). (Simonov Denis)
+- Standard:
+ . Fixed bug #76136 (stream_socket_get_name should enclose IPv6 in brackets).
+ (seliver)
+
05 Jul 2018, PHP 7.3.0alpha3
- Core:
Standard:
. Undefined variables passed to compact() will now be reported as a notice.
. getimagesize() and related functions now report the mime type of BMP images
- as image/bmp instead of image/x-ms-bmp, since the former has been registered
- with the IANA (see RFC 7903).
+ as image/bmp instead of image/x-ms-bmp, since the former has been registered
+ with the IANA (see RFC 7903).
+ . stream_socket_get_name() will now return IPv6 addresses wrapped in brackets.
+ For example "[::1]:1337" will be returned instead of "::1:1337".
========================================
2. New Features
--- /dev/null
+--TEST--
+Bug #76136: stream_socket_get_name should enclose IPv6 in brackets
+--SKIPIF--
+<?php
+@stream_socket_client('tcp://[::1]:0', $errno);
+if ($errno != 111) {
+ die('skip IPv6 is not supported.');
+}
+?>
+--FILE--
+<?php
+$server = stream_socket_server("tcp://[::1]:1337/");
+echo stream_socket_get_name($server, false).PHP_EOL;
+$server = stream_socket_server("tcp://127.0.0.1:1337/");
+echo stream_socket_get_name($server, false);
+?>
+--EXPECT--
+[::1]:1337
+127.0.0.1:1337
case AF_INET6:
buf = (char*)inet_ntop(sa->sa_family, &((struct sockaddr_in6*)sa)->sin6_addr, (char *)&abuf, sizeof(abuf));
if (buf) {
- *textaddr = strpprintf(0, "%s:%d",
+ *textaddr = strpprintf(0, "[%s]:%d",
buf, ntohs(((struct sockaddr_in6*)sa)->sin6_port));
}