Skip to content

Commit 820a0e1

Browse files
committed
Fix review comments by DanielEScherzer
1 parent 10cf1bb commit 820a0e1

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

ext/uri/php_lexbor.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ static void fill_errors(zval *errors)
215215

216216
zval error_type;
217217
zend_enum_new(&error_type, uri_whatwg_url_validation_error_type_ce, error_str, NULL);
218-
zend_update_property(uri_whatwg_url_validation_error_ce, Z_OBJ(error), ZEND_STRL("type"), &error_type);
218+
zend_update_property_ex(uri_whatwg_url_validation_error_ce, Z_OBJ(error), ZSTR_KNOWN(ZEND_STR_TYPE), &error_type);
219219
zend_string_release_ex(error_str, false);
220220
zval_ptr_dtor(&error_type);
221221

@@ -321,7 +321,7 @@ static zend_result lexbor_write_password(struct uri_internal_t *internal_uri, zv
321321
return SUCCESS;
322322
}
323323

324-
static ZEND_RESULT_CODE init_idna(void)
324+
static zend_result init_idna(void)
325325
{
326326
if (lexbor_parser->idna != NULL) {
327327
return SUCCESS;
@@ -471,7 +471,7 @@ static zend_result lexbor_write_query(struct uri_internal_t *internal_uri, zval
471471

472472
zval_string_or_null_to_lexbor_str(value, &str);
473473

474-
if ( lxb_url_api_search_set(lexbor_uri, lexbor_parser, str.data, str.length) != LXB_STATUS_OK) {
474+
if (lxb_url_api_search_set(lexbor_uri, lexbor_parser, str.data, str.length) != LXB_STATUS_OK) {
475475
fill_errors(errors);
476476

477477
return FAILURE;

ext/uri/php_uri.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ PHP_METHOD(Uri_WhatWg_UrlValidationError, __construct)
152152
RETURN_THROWS();
153153
}
154154

155-
zend_update_property(uri_whatwg_url_validation_error_ce, Z_OBJ_P(ZEND_THIS), ZEND_STRL("type"), type);
155+
zend_update_property_ex(uri_whatwg_url_validation_error_ce, Z_OBJ_P(ZEND_THIS), ZSTR_KNOWN(ZEND_STR_TYPE), type);
156156
if (EG(exception)) {
157157
RETURN_THROWS();
158158
}
@@ -347,21 +347,16 @@ static void uri_unserialize(INTERNAL_FUNCTION_PARAMETERS, const char *handler_na
347347
RETURN_THROWS();
348348
}
349349

350-
zval errors;
351-
ZVAL_UNDEF(&errors);
352-
353350
uri_internal_t *internal_uri = uri_internal_from_obj(object);
354351
internal_uri->handler = uri_handler_by_name(handler_name, strlen(handler_name));
355352
if (internal_uri->uri != NULL) {
356353
internal_uri->handler->free_uri(internal_uri->uri);
357354
}
358-
internal_uri->uri = internal_uri->handler->parse_uri(Z_STR_P(uri_zv), NULL, &errors);
355+
internal_uri->uri = internal_uri->handler->parse_uri(Z_STR_P(uri_zv), NULL, NULL);
359356
if (internal_uri->uri == NULL) {
360357
zend_throw_exception_ex(NULL, 0, "Invalid serialization data for %s object", ZSTR_VAL(object->ce->name));
361-
zval_ptr_dtor(&errors);
362358
RETURN_THROWS();
363359
}
364-
zval_ptr_dtor(&errors);
365360

366361
/* Unserialize regular properties: second array */
367362
arr = zend_hash_index_find(data, 1);

0 commit comments

Comments
 (0)