Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ var_dump($url2->toAsciiString());
?>
--EXPECT--
NULL
NULL
string(0) ""
string(21) "https://example.com/#"
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ var_dump($url2->toAsciiString());
?>
--EXPECT--
NULL
NULL
string(0) ""
string(21) "https://example.com/?"
6 changes: 3 additions & 3 deletions ext/uri/uri_parser_whatwg.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down