Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ext/uri/php_uri_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ typedef enum php_uri_component_read_mode {

typedef zend_result (*php_uri_property_handler_read)(void *uri, php_uri_component_read_mode read_mode, zval *retval);

typedef zend_result (*php_uri_property_handler_write)(void *uri, zval *value, zval *errors);
typedef zend_result (*php_uri_property_handler_write)(void *uri, const zval *value, zval *errors);

typedef enum php_uri_property_name {
PHP_URI_PROPERTY_NAME_SCHEME,
Expand Down
12 changes: 6 additions & 6 deletions ext/uri/uri_parser_rfc3986.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ ZEND_ATTRIBUTE_NONNULL static zend_result php_uri_parser_rfc3986_scheme_read(voi
return SUCCESS;
}

static zend_result php_uri_parser_rfc3986_scheme_write(void *uri, zval *value, zval *errors)
static zend_result php_uri_parser_rfc3986_scheme_write(void *uri, const zval *value, zval *errors)
{
UriUriA *uriparser_uri = get_uri_for_writing(uri);
int result;
Expand Down Expand Up @@ -305,7 +305,7 @@ ZEND_ATTRIBUTE_NONNULL void php_uri_parser_rfc3986_host_type_read(php_uri_parser
ZVAL_OBJ_COPY(retval, zend_enum_get_case_cstr(php_uri_ce_rfc3986_uri_host_type, type));
}

static zend_result php_uri_parser_rfc3986_host_write(void *uri, zval *value, zval *errors)
static zend_result php_uri_parser_rfc3986_host_write(void *uri, const zval *value, zval *errors)
{
UriUriA *uriparser_uri = get_uri_for_writing(uri);
int result;
Expand Down Expand Up @@ -366,7 +366,7 @@ ZEND_ATTRIBUTE_NONNULL static zend_result php_uri_parser_rfc3986_port_read(void
return SUCCESS;
}

static zend_result php_uri_parser_rfc3986_port_write(void *uri, zval *value, zval *errors)
static zend_result php_uri_parser_rfc3986_port_write(void *uri, const zval *value, zval *errors)
{
UriUriA *uriparser_uri = get_uri_for_writing(uri);
int result;
Expand Down Expand Up @@ -439,7 +439,7 @@ ZEND_ATTRIBUTE_NONNULL static zend_result php_uri_parser_rfc3986_path_read(void
return SUCCESS;
}

static zend_result php_uri_parser_rfc3986_path_write(void *uri, zval *value, zval *errors)
static zend_result php_uri_parser_rfc3986_path_write(void *uri, const zval *value, zval *errors)
{
UriUriA *uriparser_uri = get_uri_for_writing(uri);
int result;
Expand Down Expand Up @@ -476,7 +476,7 @@ ZEND_ATTRIBUTE_NONNULL static zend_result php_uri_parser_rfc3986_query_read(void
return SUCCESS;
}

static zend_result php_uri_parser_rfc3986_query_write(void *uri, zval *value, zval *errors)
static zend_result php_uri_parser_rfc3986_query_write(void *uri, const zval *value, zval *errors)
{
UriUriA *uriparser_uri = get_uri_for_writing(uri);
int result;
Expand Down Expand Up @@ -513,7 +513,7 @@ ZEND_ATTRIBUTE_NONNULL static zend_result php_uri_parser_rfc3986_fragment_read(v
return SUCCESS;
}

static zend_result php_uri_parser_rfc3986_fragment_write(void *uri, zval *value, zval *errors)
static zend_result php_uri_parser_rfc3986_fragment_write(void *uri, const zval *value, zval *errors)
{
UriUriA *uriparser_uri = get_uri_for_writing(uri);
int result;
Expand Down
26 changes: 13 additions & 13 deletions ext/uri/uri_parser_whatwg.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ ZEND_TLS lxb_unicode_idna_t lexbor_idna = {0};

static const size_t lexbor_mraw_byte_size = 8192;

static zend_always_inline void zval_string_or_null_to_lexbor_str(zval *value, lexbor_str_t *lexbor_str)
static zend_always_inline void zval_string_or_null_to_lexbor_str(const zval *value, lexbor_str_t *lexbor_str)
{
if (Z_TYPE_P(value) == IS_STRING && Z_STRLEN_P(value) > 0) {
lexbor_str->data = (lxb_char_t *) Z_STRVAL_P(value);
Expand All @@ -40,12 +40,12 @@ static zend_always_inline void zval_string_or_null_to_lexbor_str(zval *value, le
}
}

static zend_always_inline void zval_long_or_null_to_lexbor_str(zval *value, lexbor_str_t *lexbor_str)
static zend_always_inline void zval_long_or_null_to_lexbor_str(const zval *value, lexbor_str_t *lexbor_str)
{
if (Z_TYPE_P(value) == IS_LONG) {
ZVAL_STR(value, zend_long_to_str(Z_LVAL_P(value)));
lexbor_str_init_append(lexbor_str, lexbor_parser.mraw, (const lxb_char_t *) Z_STRVAL_P(value), Z_STRLEN_P(value));
zval_ptr_dtor_str(value);
zend_string *tmp = zend_long_to_str(Z_LVAL_P(value));
lexbor_str_init_append(lexbor_str, lexbor_parser.mraw, (const lxb_char_t *) ZSTR_VAL(tmp), ZSTR_LEN(tmp));
zend_string_release(tmp);
} else {
ZEND_ASSERT(Z_ISNULL_P(value));
lexbor_str->data = (lxb_char_t *) "";
Expand Down Expand Up @@ -257,7 +257,7 @@ static zend_result php_uri_parser_whatwg_scheme_read(void *uri, php_uri_componen
return SUCCESS;
}

static zend_result php_uri_parser_whatwg_scheme_write(void *uri, zval *value, zval *errors)
static zend_result php_uri_parser_whatwg_scheme_write(void *uri, const zval *value, zval *errors)
{
lxb_url_t *lexbor_uri = uri;
lexbor_str_t str = {0};
Expand Down Expand Up @@ -297,7 +297,7 @@ static zend_result php_uri_parser_whatwg_username_read(void *uri, php_uri_compon
return SUCCESS;
}

static zend_result php_uri_parser_whatwg_username_write(void *uri, zval *value, zval *errors)
static zend_result php_uri_parser_whatwg_username_write(void *uri, const zval *value, zval *errors)
{
lxb_url_t *lexbor_uri = uri;
lexbor_str_t str = {0};
Expand Down Expand Up @@ -326,7 +326,7 @@ static zend_result php_uri_parser_whatwg_password_read(void *uri, php_uri_compon
return SUCCESS;
}

static zend_result php_uri_parser_whatwg_password_write(void *uri, zval *value, zval *errors)
static zend_result php_uri_parser_whatwg_password_write(void *uri, const zval *value, zval *errors)
{
lxb_url_t *lexbor_uri = uri;
lexbor_str_t str = {0};
Expand Down Expand Up @@ -411,7 +411,7 @@ ZEND_ATTRIBUTE_NONNULL void php_uri_parser_whatwg_host_type_read(const lxb_url_t
}
}

static zend_result php_uri_parser_whatwg_host_write(void *uri, zval *value, zval *errors)
static zend_result php_uri_parser_whatwg_host_write(void *uri, const zval *value, zval *errors)
{
lxb_url_t *lexbor_uri = uri;
lexbor_str_t str = {0};
Expand Down Expand Up @@ -440,7 +440,7 @@ static zend_result php_uri_parser_whatwg_port_read(void *uri, php_uri_component_
return SUCCESS;
}

static zend_result php_uri_parser_whatwg_port_write(void *uri, zval *value, zval *errors)
static zend_result php_uri_parser_whatwg_port_write(void *uri, const zval *value, zval *errors)
{
lxb_url_t *lexbor_uri = uri;
lexbor_str_t str = {0};
Expand Down Expand Up @@ -469,7 +469,7 @@ static zend_result php_uri_parser_whatwg_path_read(void *uri, php_uri_component_
return SUCCESS;
}

static zend_result php_uri_parser_whatwg_path_write(void *uri, zval *value, zval *errors)
static zend_result php_uri_parser_whatwg_path_write(void *uri, const zval *value, zval *errors)
{
lxb_url_t *lexbor_uri = uri;
lexbor_str_t str = {0};
Expand Down Expand Up @@ -498,7 +498,7 @@ static zend_result php_uri_parser_whatwg_query_read(void *uri, php_uri_component
return SUCCESS;
}

static zend_result php_uri_parser_whatwg_query_write(void *uri, zval *value, zval *errors)
static zend_result php_uri_parser_whatwg_query_write(void *uri, const zval *value, zval *errors)
{
lxb_url_t *lexbor_uri = uri;
lexbor_str_t str = {0};
Expand Down Expand Up @@ -527,7 +527,7 @@ static zend_result php_uri_parser_whatwg_fragment_read(void *uri, php_uri_compon
return SUCCESS;
}

static zend_result php_uri_parser_whatwg_fragment_write(void *uri, zval *value, zval *errors)
static zend_result php_uri_parser_whatwg_fragment_write(void *uri, const zval *value, zval *errors)
{
lxb_url_t *lexbor_uri = uri;
lexbor_str_t str = {0};
Expand Down
Loading