From bf707312df65051835aee6098fb42f5ad1900ca8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Kocsis?= Date: Fri, 17 Oct 2025 23:13:11 +0200 Subject: [PATCH 1/2] ext/uri: Fix the distinction between an empty and a missing query/fragment for WHATWG URLs --- NEWS | 3 +++ .../whatwg/modification/fragment_success_hashmark.phpt | 2 +- .../whatwg/modification/query_success_question_mark.phpt | 2 +- ext/uri/uri_parser_whatwg.c | 6 +++--- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/NEWS b/NEWS index ba12a18817c2c..da5834a06b231 100644 --- a/NEWS +++ b/NEWS @@ -32,6 +32,9 @@ PHP NEWS . Use the "includes credentials" rule of the WHATWG URL Standard to decide whether Uri\WhatWg\Url::getUsername() and ::getPassword() getters should return null or an empty string. (timwolla) + . Fixed the distinction between an empty and a missing query/fragment + when using Uri\WhatWg\Url::getQuery() and Uri\WhatWg\Url::getFragment(). + (kocsismate) - Zip: . Fixed missing zend_release_fcall_info_cache on the following methods diff --git a/ext/uri/tests/whatwg/modification/fragment_success_hashmark.phpt b/ext/uri/tests/whatwg/modification/fragment_success_hashmark.phpt index 12ce6d6e6b64d..4639d993df04d 100644 --- a/ext/uri/tests/whatwg/modification/fragment_success_hashmark.phpt +++ b/ext/uri/tests/whatwg/modification/fragment_success_hashmark.phpt @@ -15,5 +15,5 @@ var_dump($url2->toAsciiString()); ?> --EXPECT-- NULL -NULL +string(0) "" string(21) "https://example.com/#" diff --git a/ext/uri/tests/whatwg/modification/query_success_question_mark.phpt b/ext/uri/tests/whatwg/modification/query_success_question_mark.phpt index 18a1593a9819a..3e1bf5ab9dce5 100644 --- a/ext/uri/tests/whatwg/modification/query_success_question_mark.phpt +++ b/ext/uri/tests/whatwg/modification/query_success_question_mark.phpt @@ -15,5 +15,5 @@ var_dump($url2->toAsciiString()); ?> --EXPECT-- NULL -NULL +string(0) "" string(21) "https://example.com/?" diff --git a/ext/uri/uri_parser_whatwg.c b/ext/uri/uri_parser_whatwg.c index ef9bf0e020c34..2e9ffad22d463 100644 --- a/ext/uri/uri_parser_whatwg.c +++ b/ext/uri/uri_parser_whatwg.c @@ -431,7 +431,7 @@ static zend_result php_uri_parser_whatwg_path_read(void *uri, php_uri_component_ { const lxb_url_t *lexbor_uri = uri; - if (lexbor_uri->path.str.length) { + if (lexbor_uri->path.str.length > 0) { ZVAL_STRINGL(retval, (const char *) lexbor_uri->path.str.data, lexbor_uri->path.str.length); } else { ZVAL_EMPTY_STRING(retval); @@ -460,7 +460,7 @@ static zend_result php_uri_parser_whatwg_query_read(void *uri, php_uri_component { const lxb_url_t *lexbor_uri = uri; - if (lexbor_uri->query.length) { + if (lexbor_uri->query.data != NULL) { ZVAL_STRINGL(retval, (const char *) lexbor_uri->query.data, lexbor_uri->query.length); } else { ZVAL_NULL(retval); @@ -489,7 +489,7 @@ static zend_result php_uri_parser_whatwg_fragment_read(void *uri, php_uri_compon { const lxb_url_t *lexbor_uri = uri; - if (lexbor_uri->fragment.length) { + if (lexbor_uri->fragment.data != NULL) { ZVAL_STRINGL(retval, (const char *) lexbor_uri->fragment.data, lexbor_uri->fragment.length); } else { ZVAL_NULL(retval); From 664514e7f185f8a3b7565ace5f9d76d705e89ed0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 11 Nov 2025 16:26:29 +0100 Subject: [PATCH 2/2] Revert unintended changes to NEWS --- NEWS | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/NEWS b/NEWS index 99aebdf5d7e0a..fd2b3e70fa352 100644 --- a/NEWS +++ b/NEWS @@ -4,18 +4,25 @@ PHP NEWS - Core: . Sync all boost.context files with release 1.86.0. (mvorisek) + . Fixed bug GH-20435 (SensitiveParameter doesn't work for named argument + passing to variadic parameter). (ndossche) + . Fixed bug GH-17951 (memory_limit is not always limited by max_memory_limit). + (manuelm) -- Standard: - . Fix memory leak in array_diff() with custom type checks. (ndossche) +- DOM: + . Fix memory leak when edge case is hit when registering xpath callback. + (ndossche) - Opcache: . Fixed bug GH-20329 (opcache.file_cache broken with full interned string buffer). (Arnaud) -- URI: - . Fixed the distinction between an empty and a missing query/fragment - when using Uri\WhatWg\Url::getQuery() and Uri\WhatWg\Url::getFragment(). - (kocsismate) +- Phar: + . Fixed bug GH-20442 (Phar does not respect case-insensitiveness of + __halt_compiler() when reading stub). (ndossche, TimWolla) + +- Standard: + . Fix memory leak in array_diff() with custom type checks. (ndossche) 06 Nov 2025, PHP 8.5.0RC4