Skip to content
Merged
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
4 changes: 2 additions & 2 deletions ext/filter/logical_filters.c
Original file line number Diff line number Diff line change
Expand Up @@ -612,14 +612,14 @@ zend_result php_filter_validate_url(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
int parser_name_set;
FETCH_STR_OPTION(parser_name, URL_OPTION_URI_PARSER_CLASS);

const uri_parser_t *uri_parser = php_uri_get_parser(parser_name_set ? parser_name : NULL);
const php_uri_parser *uri_parser = php_uri_get_parser(parser_name_set ? parser_name : NULL);
if (uri_parser == NULL) {
zend_value_error("%s(): \"uri_parser_class\" option has invalid value", get_active_function_name());
RETURN_VALIDATION_FAILED
}

/* Parse the URI - if it fails, we return NULL */
php_uri *uri = php_uri_parse_to_struct(uri_parser, Z_STRVAL_P(value), Z_STRLEN_P(value), URI_COMPONENT_READ_RAW, true);
php_uri *uri = php_uri_parse_to_struct(uri_parser, Z_STRVAL_P(value), Z_STRLEN_P(value), PHP_URI_COMPONENT_READ_MODE_RAW, true);
if (uri == NULL) {
RETURN_VALIDATION_FAILED
}
Expand Down
4 changes: 2 additions & 2 deletions ext/openssl/xp_ssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -2634,7 +2634,7 @@ static char *php_openssl_get_url_name(const char *resourcename,
return NULL;
}

const uri_parser_t *uri_parser = php_stream_context_get_uri_parser("ssl", context);
const php_uri_parser *uri_parser = php_stream_context_get_uri_parser("ssl", context);
if (uri_parser == NULL) {
zend_value_error("%s(): Provided stream context has invalid value for the \"uri_parser_class\" option", get_active_function_name());
return NULL;
Expand All @@ -2647,7 +2647,7 @@ static char *php_openssl_get_url_name(const char *resourcename,

char * url_name = NULL;
zval host_zv;
zend_result result = php_uri_get_host(internal_uri, URI_COMPONENT_READ_RAW, &host_zv);
zend_result result = php_uri_get_host(internal_uri, PHP_URI_COMPONENT_READ_MODE_RAW, &host_zv);
if (result == SUCCESS && Z_TYPE(host_zv) == IS_STRING) {
const char * host = Z_STRVAL(host_zv);
size_t len = Z_STRLEN(host_zv);
Expand Down
8 changes: 4 additions & 4 deletions ext/soap/php_http.c
Original file line number Diff line number Diff line change
Expand Up @@ -431,12 +431,12 @@ int make_http_soap_request(
}

if (location != NULL && ZSTR_VAL(location)[0] != '\000') {
const uri_parser_t *uri_parser = php_uri_get_parser(uri_parser_class);
const php_uri_parser *uri_parser = php_uri_get_parser(uri_parser_class);
if (uri_parser == NULL) {
zend_argument_value_error(6, "must be a valid URI parser name");
return FALSE;
}
uri = php_uri_parse_to_struct(uri_parser, ZSTR_VAL(location), ZSTR_LEN(location), URI_COMPONENT_READ_RAW, true);
uri = php_uri_parse_to_struct(uri_parser, ZSTR_VAL(location), ZSTR_LEN(location), PHP_URI_COMPONENT_READ_MODE_RAW, true);
}

tmp = Z_CLIENT_STREAM_CONTEXT_P(this_ptr);
Expand Down Expand Up @@ -1148,14 +1148,14 @@ int make_http_soap_request(
char *loc;

if ((loc = get_http_header_value(ZSTR_VAL(http_headers), "Location:")) != NULL) {
const uri_parser_t *uri_parser = php_uri_get_parser(uri_parser_class);
const php_uri_parser *uri_parser = php_uri_get_parser(uri_parser_class);
if (uri_parser == NULL) {
efree(loc);
zend_argument_value_error(6, "must be a valid URI parser name");
return FALSE;
}

php_uri *new_uri = php_uri_parse_to_struct(uri_parser, loc, strlen(loc), URI_COMPONENT_READ_RAW, true);
php_uri *new_uri = php_uri_parse_to_struct(uri_parser, loc, strlen(loc), PHP_URI_COMPONENT_READ_MODE_RAW, true);
efree(loc);

if (new_uri != NULL) {
Expand Down
10 changes: 5 additions & 5 deletions ext/standard/ftp_fopen_wrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,13 @@ static php_stream *php_ftp_fopen_connect(php_stream_wrapper *wrapper, const char
char *transport;
int transport_len;

const uri_parser_t *uri_parser = php_stream_context_get_uri_parser("ftp", context);
const php_uri_parser *uri_parser = php_stream_context_get_uri_parser("ftp", context);
if (uri_parser == NULL) {
zend_value_error("%s(): Provided stream context has invalid value for the \"uri_parser_class\" option", get_active_function_name());
return NULL;
}

resource = php_uri_parse_to_struct(uri_parser, path, strlen(path), URI_COMPONENT_READ_RAW, true);
resource = php_uri_parse_to_struct(uri_parser, path, strlen(path), PHP_URI_COMPONENT_READ_MODE_RAW, true);
if (resource == NULL || resource->path == NULL) {
if (resource && presource) {
*presource = resource;
Expand Down Expand Up @@ -956,18 +956,18 @@ static int php_stream_ftp_rename(php_stream_wrapper *wrapper, const char *url_fr
int result;
char tmp_line[512];

const uri_parser_t *uri_parser = php_stream_context_get_uri_parser("ftp", context);
const php_uri_parser *uri_parser = php_stream_context_get_uri_parser("ftp", context);
if (uri_parser == NULL) {
zend_value_error("%s(): Provided stream context has invalid value for the \"uri_parser_class\" option", get_active_function_name());
return 0;
}

resource_from = php_uri_parse_to_struct(uri_parser, url_from, strlen(url_from), URI_COMPONENT_READ_RAW, true);
resource_from = php_uri_parse_to_struct(uri_parser, url_from, strlen(url_from), PHP_URI_COMPONENT_READ_MODE_RAW, true);
if (!resource_from) {
return 0;
}

resource_to = php_uri_parse_to_struct(uri_parser, url_to, strlen(url_to), URI_COMPONENT_READ_RAW, true);
resource_to = php_uri_parse_to_struct(uri_parser, url_to, strlen(url_to), PHP_URI_COMPONENT_READ_MODE_RAW, true);
if (!resource_to) {
goto rename_errexit;
}
Expand Down
6 changes: 3 additions & 3 deletions ext/standard/http_fopen_wrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -393,12 +393,12 @@ static php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper,
return NULL;
}

const uri_parser_t *uri_parser = php_stream_context_get_uri_parser("http", context);
const php_uri_parser *uri_parser = php_stream_context_get_uri_parser("http", context);
if (uri_parser == NULL) {
zend_value_error("%s(): Provided stream context has invalid value for the \"uri_parser_class\" option", get_active_function_name());
return NULL;
}
resource = php_uri_parse_to_struct(uri_parser, path, strlen(path), URI_COMPONENT_READ_RAW, true);
resource = php_uri_parse_to_struct(uri_parser, path, strlen(path), PHP_URI_COMPONENT_READ_MODE_RAW, true);
if (resource == NULL) {
return NULL;
}
Expand Down Expand Up @@ -1097,7 +1097,7 @@ static php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper,

php_uri_struct_free(resource);
/* check for invalid redirection URLs */
if ((resource = php_uri_parse_to_struct(uri_parser, new_path, strlen(new_path), URI_COMPONENT_READ_RAW, true)) == NULL) {
if ((resource = php_uri_parse_to_struct(uri_parser, new_path, strlen(new_path), PHP_URI_COMPONENT_READ_MODE_RAW, true)) == NULL) {
php_stream_wrapper_log_error(wrapper, options, "Invalid redirect URL! %s", new_path);
efree(new_path);
goto out;
Expand Down
Loading