Skip to content

Commit 2014eb2

Browse files
authored
ext/uri: Fix GH-22629 WHATWG validation error incorrect with empty host and non-empty userinfo (#22699)
The returned error code (LXB_URL_ERROR_TYPE_INVALID_CREDENTIALS) apparently contradicts the specification: "If atSignSeen is true and buffer is the empty string, host-missing validation error, return failure."
1 parent ca2399e commit 2014eb2

12 files changed

Lines changed: 60 additions & 10 deletions

NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ PHP NEWS
104104
- URI:
105105
. Fixed behavior of Uri\WhatWg\Url wither methods with regards to empty
106106
opaque hosts. (kocsismate)
107+
. Fixed bug GH-22629 (WHATWG Validation error incorrect with empty host and
108+
non-empty userinfo). (kocsismate)
107109

108110
- Zip:
109111
. Fixed bug GH-22649 (ZipArchive::setCommentName() and setCommentIndex()

ext/lexbor/lexbor/url/url.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1814,7 +1814,7 @@ lxb_url_parse_basic_h(lxb_url_parser_t *parser, lxb_url_t *url,
18141814
if (at_sign) {
18151815
if (begin == p || begin == p - 1) {
18161816
status = lxb_url_log_append(parser, p,
1817-
LXB_URL_ERROR_TYPE_INVALID_CREDENTIALS);
1817+
LXB_URL_ERROR_TYPE_HOST_MISSING);
18181818
if (status != LXB_STATUS_OK) {
18191819
lxb_url_parse_return(orig_data, buf, status);
18201820
}

ext/lexbor/patches/0001-Expose-line-and-column-information-for-use-in-PHP.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
22
From: Niels Dossche <7771979+nielsdos@users.noreply.github.com>
33
Date: Sat, 26 Aug 2023 15:08:59 +0200
4-
Subject: [PATCH 1/8] Expose line and column information for use in PHP
4+
Subject: [PATCH 1/9] Expose line and column information for use in PHP
55

66
---
77
source/lexbor/dom/interfaces/node.h | 2 ++

ext/lexbor/patches/0002-Track-implied-added-nodes-for-options-use-in-PHP.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
22
From: Niels Dossche <7771979+nielsdos@users.noreply.github.com>
33
Date: Mon, 14 Aug 2023 20:18:51 +0200
4-
Subject: [PATCH 2/8] Track implied added nodes for options use in PHP
4+
Subject: [PATCH 2/9] Track implied added nodes for options use in PHP
55

66
---
77
source/lexbor/html/tree.h | 3 +++

ext/lexbor/patches/0003-Patch-utilities-and-data-structure-to-be-able-to-gen.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
22
From: Niels Dossche <7771979+nielsdos@users.noreply.github.com>
33
Date: Thu, 24 Aug 2023 22:57:48 +0200
4-
Subject: [PATCH 3/8] Patch utilities and data structure to be able to generate
4+
Subject: [PATCH 3/9] Patch utilities and data structure to be able to generate
55
smaller lookup tables
66

77
Changed the generation script to check if everything fits in 32-bits.

ext/lexbor/patches/0004-Remove-unused-upper-case-tag-static-data.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
22
From: Niels Dossche <7771979+nielsdos@users.noreply.github.com>
33
Date: Wed, 29 Nov 2023 21:26:47 +0100
4-
Subject: [PATCH 4/8] Remove unused upper case tag static data
4+
Subject: [PATCH 4/9] Remove unused upper case tag static data
55

66
---
77
source/lexbor/tag/res.h | 2 ++

ext/lexbor/patches/0005-Shrink-size-of-static-binary-search-tree.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
22
From: Niels Dossche <7771979+nielsdos@users.noreply.github.com>
33
Date: Wed, 29 Nov 2023 21:29:31 +0100
4-
Subject: [PATCH 5/8] Shrink size of static binary search tree
4+
Subject: [PATCH 5/9] Shrink size of static binary search tree
55

66
This also makes it more efficient on the data cache.
77
---

ext/lexbor/patches/0006-Patch-out-unused-CSS-style-code.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
22
From: Niels Dossche <7771979+nielsdos@users.noreply.github.com>
33
Date: Sun, 7 Jan 2024 21:59:28 +0100
4-
Subject: [PATCH 6/8] Patch out unused CSS style code
4+
Subject: [PATCH 6/9] Patch out unused CSS style code
55

66
---
77
source/lexbor/css/rule.h | 2 ++

ext/lexbor/patches/0007-URL-fixed-setters-for-empty-hosts.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
22
From: Alexander Borisov <lex.borisov@gmail.com>
33
Date: Fri, 26 Jun 2026 18:55:56 +0300
4-
Subject: [PATCH 7/8] URL: fixed setters for empty hosts.
4+
Subject: [PATCH 7/9] URL: fixed setters for empty hosts.
55
MIME-Version: 1.0
66
Content-Type: text/plain; charset=UTF-8
77
Content-Transfer-Encoding: 8bit

ext/lexbor/patches/0008-URL-fixed-uninitialized-memory-in-the-path-buffer-gr.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
22
From: Alexander Borisov <lex.borisov@gmail.com>
33
Date: Fri, 5 Jun 2026 22:13:32 +0300
4-
Subject: [PATCH 8/8] URL: fixed uninitialized memory in the path buffer
4+
Subject: [PATCH 8/9] URL: fixed uninitialized memory in the path buffer
55
growth.
66

77
When a path was long enough to outgrow the on-stack buffer, the first

0 commit comments

Comments
 (0)