From 0d8fe16f08dda99b7fc7968d6df7eacb64ae0aa7 Mon Sep 17 00:00:00 2001 From: Funda Wang Date: Sat, 22 Nov 2025 11:16:47 +0800 Subject: [PATCH] 8.3.28 --- php-8.3.27.tar.xz => php-8.3.28.tar.xz | 4 +- php-bug20528.patch | 81 ++++++++++++++++++++++++++ php.spec | 18 +++--- 3 files changed, 94 insertions(+), 9 deletions(-) rename php-8.3.27.tar.xz => php-8.3.28.tar.xz (32%) create mode 100644 php-bug20528.patch diff --git a/php-8.3.27.tar.xz b/php-8.3.28.tar.xz similarity index 32% rename from php-8.3.27.tar.xz rename to php-8.3.28.tar.xz index c945ed8..bf2f0ac 100644 --- a/php-8.3.27.tar.xz +++ b/php-8.3.28.tar.xz @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c15a09a9d199437144ecfef7d712ec4ca5c6820cf34acc24cc8489dd0cee41ba -size 12592316 +oid sha256:25e3860f30198a386242891c0bf9e2955931f7b666b96c3e3103d36a2a322326 +size 12604244 diff --git a/php-bug20528.patch b/php-bug20528.patch new file mode 100644 index 0000000..f8a790a --- /dev/null +++ b/php-bug20528.patch @@ -0,0 +1,81 @@ +From 9d71c1e0b60cd152a47528dbe514efc443fce920 Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Thu, 20 Nov 2025 02:58:45 +0100 +Subject: [PATCH] Fix GH-20528: Regression breaks mysql connexion using an IPv6 + address enclosed in square brackets + +--- + ext/mysqli/tests/mysqli_connect_port.phpt | 31 +++++++++++++++++++++++ + ext/mysqlnd/mysqlnd_connection.c | 17 ++++++++++--- + 2 files changed, 45 insertions(+), 3 deletions(-) + create mode 100644 ext/mysqli/tests/mysqli_connect_port.phpt + +diff --git a/ext/mysqli/tests/mysqli_connect_port.phpt b/ext/mysqli/tests/mysqli_connect_port.phpt +new file mode 100644 +index 0000000000000..cb7fd1d8d1628 +--- /dev/null ++++ b/ext/mysqli/tests/mysqli_connect_port.phpt +@@ -0,0 +1,31 @@ ++--TEST-- ++mysqli_connect() with port in host ++--EXTENSIONS-- ++mysqli ++--SKIPIF-- ++ ++--FILE-- ++ ++Done ++--EXPECTF-- ++Done +diff --git a/ext/mysqlnd/mysqlnd_connection.c b/ext/mysqlnd/mysqlnd_connection.c +index d8e7304e9665f..8268034e8b798 100644 +--- a/ext/mysqlnd/mysqlnd_connection.c ++++ b/ext/mysqlnd/mysqlnd_connection.c +@@ -553,13 +553,24 @@ MYSQLND_METHOD(mysqlnd_conn_data, get_scheme)(MYSQLND_CONN_DATA * conn, MYSQLND_ + port = 3306; + } + +- /* ipv6 addresses are in the format [address]:port */ + if (hostname.s[0] != '[' && mysqlnd_fast_is_ipv6_address(hostname.s)) { ++ /* IPv6 without square brackets so without port */ + transport.l = mnd_sprintf(&transport.s, 0, "tcp://[%s]:%u", hostname.s, port); + } else { +- /* Not ipv6, but could already contain a port number, in which case we should not add an extra port. ++ char *p; ++ ++ /* IPv6 addresses are in the format [address]:port */ ++ if (hostname.s[0] == '[') { /* IPv6 */ ++ p = strchr(hostname.s, ']'); ++ if (p && p[1] != ':') { ++ p = NULL; ++ } ++ } else { /* IPv4 or name */ ++ p = strchr(hostname.s, ':'); ++ } ++ /* Could already contain a port number, in which case we should not add an extra port. + * See GH-8978. In a port doubling scenario, the first port would be used so we do the same to keep BC. */ +- if (strchr(hostname.s, ':')) { ++ if (p) { + /* TODO: Ideally we should be able to get rid of this workaround in the future. */ + transport.l = mnd_sprintf(&transport.s, 0, "tcp://%s", hostname.s); + } else { diff --git a/php.spec b/php.spec index 2d4507a..d17647c 100644 --- a/php.spec +++ b/php.spec @@ -23,7 +23,7 @@ %global with_modphp 1 %global with_lmdb 1 %global with_sodium 1 -%global upver 8.3.27 +%global upver 8.3.28 Name: php @@ -63,6 +63,7 @@ Patch7: php-7.4.0-ldap_r.patch Patch8: php-8.3.13-phpinfo.patch Patch9: php-8.3.0-openssl-ec-param.patch Patch10: 0001-add-sw_64-support.patch +Patch11: php-bug20528.patch BuildRequires: bzip2-devel @@ -712,6 +713,7 @@ ln -sf ../configure --with-mhash \ --without-password-argon2 \ --enable-dtrace \ + --enable-sockets \ $* if test $? != 0; then tail -500 config.log @@ -755,7 +757,6 @@ build --libdir=%{_libdir}/php \ --enable-ftp=shared \ --with-gettext=shared \ --with-iconv=shared \ - --enable-sockets=shared \ --enable-tokenizer=shared \ --with-ldap=shared --with-ldap-sasl \ --enable-mysqlnd=shared \ @@ -818,7 +819,7 @@ without_shared="--without-gd \ --without-curl --disable-posix --disable-xml \ --disable-simplexml --disable-exif --without-gettext \ --without-iconv --disable-ftp --without-bz2 --disable-ctype \ - --disable-shmop --disable-sockets --disable-tokenizer \ + --disable-shmop --disable-tokenizer \ --disable-sysvmsg --disable-sysvshm --disable-sysvsem" %if %{with_modphp} @@ -885,7 +886,6 @@ build --includedir=%{_includedir}/php-zts \ %endif --with-gettext=shared \ --with-iconv=shared \ - --enable-sockets=shared \ --enable-tokenizer=shared \ --enable-exif=shared \ --enable-ftp=shared \ @@ -1034,7 +1034,7 @@ install -D -m 644 %{SOURCE10} $RPM_BUILD_ROOT%{_sysconfdir}/nginx/conf.d/php-fpm install -D -m 644 %{SOURCE14} $RPM_BUILD_ROOT%{_sysconfdir}/nginx/default.d/php.conf TESTCMD="$RPM_BUILD_ROOT%{_bindir}/php --no-php-ini" -for mod in core date filter hash libxml openssl pcntl pcre readline reflection session spl standard zlib +for mod in core date filter hash json libxml openssl pcntl pcre random readline reflection session sockets spl standard zlib do $TESTCMD --modules | grep -qi $mod done @@ -1048,7 +1048,7 @@ for mod in pgsql odbc ldap snmp \ mysqlnd mysqli \ mbstring gd dom xsl soap bcmath dba \ simplexml bz2 calendar ctype exif ftp gettext gmp iconv \ - sockets tokenizer opcache \ + tokenizer opcache \ sqlite3 \ enchant phar fileinfo intl \ ffi \ @@ -1133,7 +1133,7 @@ cat files.sqlite3 >> files.pdo cat files.curl files.phar files.fileinfo \ files.exif files.gettext files.iconv files.calendar \ - files.ftp files.bz2 files.ctype files.sockets \ + files.ftp files.bz2 files.ctype \ files.tokenizer > files.common install -m 644 %{SOURCE12} $RPM_BUILD_ROOT%{_sysconfdir}/php.d/opcache-default.blacklist @@ -1312,6 +1312,10 @@ systemctl try-restart php-fpm.service >/dev/null 2>&1 || : %{_mandir}/man?/* %changelog +* Thu Nov 20 2025 Funda Wang - 8.3.28-1 +- update to 8.3.28 +- build sockets extension statically + * Wed Oct 22 2025 Funda Wang - 8.3.27-1 - update to 8.3.27 -- Gitee