Skip to content

Commit 9921071

Browse files
committed
Fixes
1 parent 633b651 commit 9921071

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
@@ -759,20 +759,20 @@ static php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper,
759759
/* decode the strings first */
760760
php_url_decode(ZSTR_VAL(resource->user), ZSTR_LEN(resource->user));
761761

762-
smart_str_appendl(&scratch, ZSTR_VAL(resource->user), ZSTR_LEN(resource->user));
762+
smart_str_append(&scratch, resource->user);
763763
smart_str_appendc(&scratch, ':');
764764

765765
/* Note: password is optional! */
766766
if (resource->password) {
767767
php_url_decode(ZSTR_VAL(resource->password), ZSTR_LEN(resource->password));
768-
smart_str_appendl(&scratch, ZSTR_VAL(resource->password), ZSTR_LEN(resource->password));
768+
smart_str_append(&scratch, resource->password);
769769
}
770770

771771
zend_string *scratch_str = smart_str_extract(&scratch);
772772
stmp = php_base64_encode((unsigned char*)ZSTR_VAL(scratch_str), ZSTR_LEN(scratch_str));
773773

774774
smart_str_appends(&req_buf, "Authorization: Basic ");
775-
smart_str_appendl(&req_buf, ZSTR_VAL(stmp), ZSTR_LEN(stmp));
775+
smart_str_append(&req_buf, stmp);
776776
smart_str_appends(&req_buf, "\r\n");
777777

778778
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)