From 75f7a0b8ed4983418d705da6680afdc7267f6157 Mon Sep 17 00:00:00 2001 From: Soybean <159681973+OracleNep@users.noreply.github.com> Date: Wed, 3 Jun 2026 13:45:19 +0800 Subject: [PATCH 1/3] Fix typo: rename InvalidReverseSoldius to InvalidReverseSolidus in Uri\WhatWg\UrlValidationErrorType The WHATWG URL validation error is invalid-reverse-solidus, and the underlying Lexbor constant is LXB_URL_ERROR_TYPE_INVALID_REVERSE_SOLIDUS. The enum case was misspelled as InvalidReverseSoldius (missing 'l'). Changes: - Fixed enum case spelling in ext/uri/php_uri.stub.php - Fixed error string mapping in ext/uri/uri_parser_whatwg.c - Added PHPT test for the correct enum case name --- ext/uri/php_uri.stub.php | 2 +- ext/uri/tests/invalid_reverse_solidus_enum.phpt | 17 +++++++++++++++++ ext/uri/uri_parser_whatwg.c | 2 +- 3 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 ext/uri/tests/invalid_reverse_solidus_enum.phpt diff --git a/ext/uri/php_uri.stub.php b/ext/uri/php_uri.stub.php index b0b83fcf83ec..447d3a3321da 100644 --- a/ext/uri/php_uri.stub.php +++ b/ext/uri/php_uri.stub.php @@ -153,7 +153,7 @@ enum UrlValidationErrorType case InvalidUrlUnit; case SpecialSchemeMissingFollowingSolidus; case MissingSchemeNonRelativeUrl; - case InvalidReverseSoldius; + case InvalidReverseSolidus; case InvalidCredentials; case HostMissing; case PortOutOfRange; diff --git a/ext/uri/tests/invalid_reverse_solidus_enum.phpt b/ext/uri/tests/invalid_reverse_solidus_enum.phpt new file mode 100644 index 000000000000..64b0971909dc --- /dev/null +++ b/ext/uri/tests/invalid_reverse_solidus_enum.phpt @@ -0,0 +1,17 @@ +--TEST-- +Uri\WhatWg\UrlValidationErrorType uses the correct InvalidReverseSolidus spelling +--EXTENSIONS-- +uri +--FILE-- + $case->name, + Uri\WhatWg\UrlValidationErrorType::cases(), +); + +var_dump(in_array('InvalidReverseSolidus', $caseNames, true)); +var_dump(in_array('InvalidReverseSoldius', $caseNames, true)); +?> +--EXPECT-- +bool(true) +bool(false) \ No newline at end of file diff --git a/ext/uri/uri_parser_whatwg.c b/ext/uri/uri_parser_whatwg.c index f4e148704004..241c9f2d2513 100644 --- a/ext/uri/uri_parser_whatwg.c +++ b/ext/uri/uri_parser_whatwg.c @@ -167,7 +167,7 @@ static const char *fill_errors(zval *errors) ZVAL_TRUE(&failure); break; case LXB_URL_ERROR_TYPE_INVALID_REVERSE_SOLIDUS: - error_str = "InvalidReverseSoldius"; + error_str = "InvalidReverseSolidus"; ZVAL_FALSE(&failure); break; case LXB_URL_ERROR_TYPE_INVALID_CREDENTIALS: From ab8cdcf872c4f44b7ca1badc6e26c43468d25d94 Mon Sep 17 00:00:00 2001 From: Soybean <159681973+OracleNep@users.noreply.github.com> Date: Wed, 3 Jun 2026 14:09:21 +0800 Subject: [PATCH 2/3] Fix generated Uri arginfo spelling Update the generated URI arginfo header so the enum case registration matches the corrected InvalidReverseSolidus spelling. Also add the missing trailing newline to the new PHPT test. --- ext/uri/php_uri_arginfo.h | 2 +- ext/uri/tests/invalid_reverse_solidus_enum.phpt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/uri/php_uri_arginfo.h b/ext/uri/php_uri_arginfo.h index 0fb464ee74aa..88febe86a737 100644 --- a/ext/uri/php_uri_arginfo.h +++ b/ext/uri/php_uri_arginfo.h @@ -480,7 +480,7 @@ static zend_class_entry *register_class_Uri_WhatWg_UrlValidationErrorType(void) zend_enum_add_case_cstr(class_entry, "MissingSchemeNonRelativeUrl", NULL); - zend_enum_add_case_cstr(class_entry, "InvalidReverseSoldius", NULL); + zend_enum_add_case_cstr(class_entry, "InvalidReverseSolidus", NULL); zend_enum_add_case_cstr(class_entry, "InvalidCredentials", NULL); diff --git a/ext/uri/tests/invalid_reverse_solidus_enum.phpt b/ext/uri/tests/invalid_reverse_solidus_enum.phpt index 64b0971909dc..753841b15736 100644 --- a/ext/uri/tests/invalid_reverse_solidus_enum.phpt +++ b/ext/uri/tests/invalid_reverse_solidus_enum.phpt @@ -14,4 +14,4 @@ var_dump(in_array('InvalidReverseSoldius', $caseNames, true)); ?> --EXPECT-- bool(true) -bool(false) \ No newline at end of file +bool(false) From d4e15571898169e67042238bae2c1d828ba40691 Mon Sep 17 00:00:00 2001 From: Soybean <159681973+OracleNep@users.noreply.github.com> Date: Wed, 3 Jun 2026 14:31:37 +0800 Subject: [PATCH 3/3] Update generated URI headers Refresh the generated URI arginfo and declaration headers after correcting the InvalidReverseSolidus enum case spelling. --- ext/uri/php_uri_arginfo.h | 2 +- ext/uri/php_uri_decl.h | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ext/uri/php_uri_arginfo.h b/ext/uri/php_uri_arginfo.h index 88febe86a737..d1bff8f2dbbc 100644 --- a/ext/uri/php_uri_arginfo.h +++ b/ext/uri/php_uri_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit php_uri.stub.php instead. - * Stub hash: a3b4696ac001d537cc34b818715c7eb382c17c5b + * Stub hash: 8bf205edfa9cb281e73daf66285aa6a60f3431c0 * Has decl header: yes */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Uri_Rfc3986_Uri_parse, 0, 1, IS_STATIC, 1) diff --git a/ext/uri/php_uri_decl.h b/ext/uri/php_uri_decl.h index d1fd58d04b2c..8b8a980846db 100644 --- a/ext/uri/php_uri_decl.h +++ b/ext/uri/php_uri_decl.h @@ -1,8 +1,8 @@ /* This is a generated file, edit php_uri.stub.php instead. - * Stub hash: a3b4696ac001d537cc34b818715c7eb382c17c5b */ + * Stub hash: 8bf205edfa9cb281e73daf66285aa6a60f3431c0 */ -#ifndef ZEND_PHP_URI_DECL_a3b4696ac001d537cc34b818715c7eb382c17c5b_H -#define ZEND_PHP_URI_DECL_a3b4696ac001d537cc34b818715c7eb382c17c5b_H +#ifndef ZEND_PHP_URI_DECL_8bf205edfa9cb281e73daf66285aa6a60f3431c0_H +#define ZEND_PHP_URI_DECL_8bf205edfa9cb281e73daf66285aa6a60f3431c0_H typedef enum zend_enum_Uri_UriComparisonMode { ZEND_ENUM_Uri_UriComparisonMode_IncludeFragment = 1, @@ -46,7 +46,7 @@ typedef enum zend_enum_Uri_WhatWg_UrlValidationErrorType { ZEND_ENUM_Uri_WhatWg_UrlValidationErrorType_InvalidUrlUnit = 20, ZEND_ENUM_Uri_WhatWg_UrlValidationErrorType_SpecialSchemeMissingFollowingSolidus = 21, ZEND_ENUM_Uri_WhatWg_UrlValidationErrorType_MissingSchemeNonRelativeUrl = 22, - ZEND_ENUM_Uri_WhatWg_UrlValidationErrorType_InvalidReverseSoldius = 23, + ZEND_ENUM_Uri_WhatWg_UrlValidationErrorType_InvalidReverseSolidus = 23, ZEND_ENUM_Uri_WhatWg_UrlValidationErrorType_InvalidCredentials = 24, ZEND_ENUM_Uri_WhatWg_UrlValidationErrorType_HostMissing = 25, ZEND_ENUM_Uri_WhatWg_UrlValidationErrorType_PortOutOfRange = 26, @@ -63,4 +63,4 @@ typedef enum zend_enum_Uri_WhatWg_UrlHostType { ZEND_ENUM_Uri_WhatWg_UrlHostType_Empty = 5, } zend_enum_Uri_WhatWg_UrlHostType; -#endif /* ZEND_PHP_URI_DECL_a3b4696ac001d537cc34b818715c7eb382c17c5b_H */ +#endif /* ZEND_PHP_URI_DECL_8bf205edfa9cb281e73daf66285aa6a60f3431c0_H */