Skip to content

Commit 703b5bb

Browse files
committed
ext/uri: Fix throwing Uri\UriError
Since it doesn't have an $errors property
1 parent 8b005d4 commit 703b5bb

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

‎ext/uri/uri_parser_whatwg.c‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -736,9 +736,9 @@ static void php_uri_parser_whatwg_destroy(void *uri)
736736
lxb_url_destroy(lexbor_uri);
737737
}
738738

739-
ZEND_ATTRIBUTE_NONNULL static void php_uri_parser_whatwg_throw_exception(zend_class_entry *exception_ce, const char *message)
739+
ZEND_ATTRIBUTE_NONNULL static void php_uri_parser_whatwg_throw_exception(const char *message)
740740
{
741-
zend_object *exception = zend_throw_exception(exception_ce, message, 0);
741+
zend_object *exception = zend_throw_exception(php_uri_ce_whatwg_invalid_url_exception, message, 0);
742742
zval errors;
743743
ZVAL_EMPTY_ARRAY(&errors);
744744
zend_update_property(exception->ce, exception, ZEND_STRL("errors"), &errors);
@@ -1043,7 +1043,7 @@ ZEND_ATTRIBUTE_NONNULL_ARGS(2, 3, 4, 5, 6, 7, 8, 9) lxb_url_t *php_uri_parser_wh
10431043

10441044
lxb_url_t *lexbor_url = lexbor_mraw_calloc(lexbor_parser.mraw, sizeof(*lexbor_url));
10451045
if (lexbor_url == NULL) {
1046-
php_uri_parser_whatwg_throw_exception(php_uri_ce_error, "Memory allocation error");
1046+
zend_throw_exception(php_uri_ce_error, "Memory allocation error", 0);
10471047
return NULL;
10481048
}
10491049

@@ -1080,17 +1080,17 @@ ZEND_ATTRIBUTE_NONNULL_ARGS(2, 3, 4, 5, 6, 7, 8, 9) lxb_url_t *php_uri_parser_wh
10801080
|| lexbor_url->host.type == LXB_URL_HOST_TYPE_EMPTY
10811081
|| lexbor_url->scheme.type == LXB_URL_SCHEMEL_TYPE_FILE) {
10821082
if (Z_TYPE_P(username) != IS_NULL) {
1083-
php_uri_parser_whatwg_throw_exception(php_uri_ce_whatwg_invalid_url_exception, "The specified URL cannot have username");
1083+
php_uri_parser_whatwg_throw_exception("The specified URL cannot have username");
10841084
goto failure;
10851085
}
10861086

10871087
if (Z_TYPE_P(password) != IS_NULL) {
1088-
php_uri_parser_whatwg_throw_exception(php_uri_ce_whatwg_invalid_url_exception, "The specified URL cannot have password");
1088+
php_uri_parser_whatwg_throw_exception("The specified URL cannot have password");
10891089
goto failure;
10901090
}
10911091

10921092
if (Z_TYPE_P(port) != IS_NULL) {
1093-
php_uri_parser_whatwg_throw_exception(php_uri_ce_whatwg_invalid_url_exception, "The specified URL cannot have port");
1093+
php_uri_parser_whatwg_throw_exception("The specified URL cannot have port");
10941094
goto failure;
10951095
}
10961096
}

0 commit comments

Comments
 (0)