Skip to content

Commit 75f7a0b

Browse files
committed
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
1 parent b5c17e7 commit 75f7a0b

3 files changed

Lines changed: 19 additions & 2 deletions

File tree

ext/uri/php_uri.stub.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ enum UrlValidationErrorType
153153
case InvalidUrlUnit;
154154
case SpecialSchemeMissingFollowingSolidus;
155155
case MissingSchemeNonRelativeUrl;
156-
case InvalidReverseSoldius;
156+
case InvalidReverseSolidus;
157157
case InvalidCredentials;
158158
case HostMissing;
159159
case PortOutOfRange;
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
--TEST--
2+
Uri\WhatWg\UrlValidationErrorType uses the correct InvalidReverseSolidus spelling
3+
--EXTENSIONS--
4+
uri
5+
--FILE--
6+
<?php
7+
$caseNames = array_map(
8+
static fn($case) => $case->name,
9+
Uri\WhatWg\UrlValidationErrorType::cases(),
10+
);
11+
12+
var_dump(in_array('InvalidReverseSolidus', $caseNames, true));
13+
var_dump(in_array('InvalidReverseSoldius', $caseNames, true));
14+
?>
15+
--EXPECT--
16+
bool(true)
17+
bool(false)

ext/uri/uri_parser_whatwg.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ static const char *fill_errors(zval *errors)
167167
ZVAL_TRUE(&failure);
168168
break;
169169
case LXB_URL_ERROR_TYPE_INVALID_REVERSE_SOLIDUS:
170-
error_str = "InvalidReverseSoldius";
170+
error_str = "InvalidReverseSolidus";
171171
ZVAL_FALSE(&failure);
172172
break;
173173
case LXB_URL_ERROR_TYPE_INVALID_CREDENTIALS:

0 commit comments

Comments
 (0)