Fix typo: rename InvalidReverseSoldius to InvalidReverseSolidus in Uri\WhatWg\UrlValidationErrorType#22217
Draft
OracleNep wants to merge 4 commits into
Draft
Fix typo: rename InvalidReverseSoldius to InvalidReverseSolidus in Uri\WhatWg\UrlValidationErrorType#22217OracleNep wants to merge 4 commits into
OracleNep wants to merge 4 commits into
Conversation
…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.
Member
|
Crap. Thank you for the report.
Yes, we'll need some backwards compatibility here. Adding a: 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. |
Contributor
|
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.
|
Register the legacy InvalidReverseSoldius spelling as a deprecated class constant alias for InvalidReverseSolidus in both the stub and generated URI arginfo.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uri\WhatWg\UrlValidationErrorType currently exposes the enum case:
php Uri\WhatWg\UrlValidationErrorType::InvalidReverseSoldiusThis 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::InvalidReverseSolidusIt 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.