Skip to content

Fix typo: rename InvalidReverseSoldius to InvalidReverseSolidus in Uri\WhatWg\UrlValidationErrorType#22217

Draft
OracleNep wants to merge 4 commits into
php:masterfrom
OracleNep:master
Draft

Fix typo: rename InvalidReverseSoldius to InvalidReverseSolidus in Uri\WhatWg\UrlValidationErrorType#22217
OracleNep wants to merge 4 commits into
php:masterfrom
OracleNep:master

Conversation

@OracleNep
Copy link
Copy Markdown

Uri\WhatWg\UrlValidationErrorType currently exposes the enum case:

php Uri\WhatWg\UrlValidationErrorType::InvalidReverseSoldius

This appears to be a typo. The WHATWG URL validation error is
invalid-reverse-solidus, and the corresponding Lexbor error constant is
LXB_URL_ERROR_TYPE_INVALID_REVERSE_SOLIDUS.

This patch updates the enum case and the WHATWG validation error mapping to use:

php Uri\WhatWg\UrlValidationErrorType::InvalidReverseSolidus

It also adds a PHPT test for the corrected case spelling.

Since the misspelled name is already present in PHP 8.5, maintainer guidance may
be needed on whether this should target master only, be backported, or preserve
compatibility with the old spelling.

This is not a security issue.

Generated files should be refreshed from ext/uri/php_uri.stub.php.

…i\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
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.
Refresh the generated URI arginfo and declaration headers after correcting the InvalidReverseSolidus enum case spelling.
@TimWolla
Copy link
Copy Markdown
Member

TimWolla commented Jun 3, 2026

Crap. Thank you for the report.

Since the misspelled name is already present in PHP 8.5, maintainer guidance may
be needed on whether this should target master only, be backported, or preserve
compatibility with the old spelling.

Yes, we'll need some backwards compatibility here. Adding a:

#[\Deprecated]
public self const InvalidReverseSoldius = self::InvalidReverseSolidus;

constant might be the way to go with minimal impact (e.g. impact on Reflection is unavoidable). We would need to check the deserialization behavior, though.

@LamentXU123
Copy link
Copy Markdown
Contributor

LamentXU123 commented Jun 3, 2026

The fix looks correct. This is technically a BC break so we might want to put it in NEWS and UPGRADING file to indicate this change to users.

Also not sure if we should target this to 8.5 instead of master :) This is not a bug fix so master will be fine.

Register the legacy InvalidReverseSoldius spelling as a deprecated class constant alias for InvalidReverseSolidus in both the stub and generated URI arginfo.
@OracleNep OracleNep marked this pull request as draft June 3, 2026 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants