Skip to content

Commit e9f0a71

Browse files
committed
Fixes
1 parent 849971c commit e9f0a71

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

ext/standard/http_fopen_wrapper.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -755,20 +755,20 @@ static php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper,
755755
/* decode the strings first */
756756
php_url_decode(ZSTR_VAL(resource->user), ZSTR_LEN(resource->user));
757757

758-
smart_str_appendl(&scratch, ZSTR_VAL(resource->user), ZSTR_LEN(resource->user));
758+
smart_str_append(&scratch, resource->user);
759759
smart_str_appendc(&scratch, ':');
760760

761761
/* Note: password is optional! */
762762
if (resource->password) {
763763
php_url_decode(ZSTR_VAL(resource->password), ZSTR_LEN(resource->password));
764-
smart_str_appendl(&scratch, ZSTR_VAL(resource->password), ZSTR_LEN(resource->password));
764+
smart_str_append(&scratch, resource->password);
765765
}
766766

767767
zend_string *scratch_str = smart_str_extract(&scratch);
768768
stmp = php_base64_encode((unsigned char*)ZSTR_VAL(scratch_str), ZSTR_LEN(scratch_str));
769769

770770
smart_str_appends(&req_buf, "Authorization: Basic ");
771-
smart_str_appendl(&req_buf, ZSTR_VAL(stmp), ZSTR_LEN(stmp));
771+
smart_str_append(&req_buf, stmp);
772772
smart_str_appends(&req_buf, "\r\n");
773773

774774
php_stream_notify_info(context, PHP_STREAM_NOTIFY_AUTH_REQUIRED, NULL, 0);

ext/standard/url.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -327,11 +327,9 @@ static void parse_url_decode_component(zval *zv, uri_component_read_mode_t read_
327327
return;
328328
}
329329

330-
if (read_mode != URI_COMPONENT_READ_NORMALIZED_ASCII && read_mode != URI_COMPONENT_READ_NORMALIZED_UNICODE) {
331-
return;
330+
if (read_mode == URI_COMPONENT_READ_RAW) {
331+
php_url_decode(Z_STRVAL_P(zv), Z_STRLEN_P(zv));
332332
}
333-
334-
php_url_decode(Z_STRVAL_P(zv), Z_STRLEN_P(zv));
335333
}
336334

337335
static zend_result parse_url_read_scheme(const uri_internal_t *internal_uri, uri_component_read_mode_t read_mode, zval *retval)

ext/uri/php_uri.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1019,7 +1019,7 @@ PHPAPI zend_result uri_handler_register(const uri_handler_t *uri_handler)
10191019
{
10201020
zend_string *key = zend_string_init_interned(uri_handler->name, strlen(uri_handler->name), true);
10211021

1022-
ZEND_ASSERT(uri_handler->name != NULL && (strlen(uri_handler->name) > 0 || strcmp(uri_handler->name, URI_PARSER_PHP) == 0));
1022+
ZEND_ASSERT(uri_handler->name != NULL);
10231023
ZEND_ASSERT(uri_handler->parse_uri != NULL);
10241024
ZEND_ASSERT(uri_handler->clone_uri != NULL || strcmp(uri_handler->name, URI_PARSER_PHP) == 0);
10251025
ZEND_ASSERT(uri_handler->uri_to_string != NULL || strcmp(uri_handler->name, URI_PARSER_PHP) == 0);

0 commit comments

Comments
 (0)