X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=http_request_object.c;h=3bf2f9871c0556d5be618989d3de579929e4846d;hb=7904ebbfd747d11f0821d2b2712600ab07a36ff6;hp=8c4bc0ef0a8edf7510fb5adcf3119540e7989e20;hpb=af3c9945f927e8e2ebdc8e7707b70ec3ba7addfc;p=m6w6%2Fext-http diff --git a/http_request_object.c b/http_request_object.c index 8c4bc0e..3bf2f98 100644 --- a/http_request_object.c +++ b/http_request_object.c @@ -450,7 +450,7 @@ STATUS _http_request_object_requesthandler(http_request_object *obj, zval *this_ case HTTP_PUT: { php_stream_statbuf ssb; - php_stream *stream = php_stream_open_wrapper(Z_STRVAL_P(GET_PROP(putFile)), "rb", REPORT_ERRORS|ENFORCE_SAFE_MODE, HTTP_DEFAULT_STREAM_CONTEXT); + php_stream *stream = php_stream_open_wrapper_ex(Z_STRVAL_P(GET_PROP(putFile)), "rb", REPORT_ERRORS|ENFORCE_SAFE_MODE, NULL, HTTP_DEFAULT_STREAM_CONTEXT); if (stream && !php_stream_stat(stream, &ssb)) { obj->request->body = http_request_body_init_ex(obj->request->body, HTTP_REQUEST_BODY_UPLOADFILE, stream, ssb.sb.st_size, 1); @@ -478,7 +478,7 @@ STATUS _http_request_object_requesthandler(http_request_object *obj, zval *this_ zval **ct_header; /* only override if not already set */ - if ((SUCCESS != zend_hash_find(Z_ARRVAL_PP(headers), "Content-Type", sizeof("Content-Type"), (void **) &ct_header)) && (Z_TYPE_PP(ct_header) == IS_STRING)) { + if ((SUCCESS != zend_hash_find(Z_ARRVAL_PP(headers), "Content-Type", sizeof("Content-Type"), (void **) &ct_header))) { add_assoc_stringl(*headers, "Content-Type", Z_STRVAL_P(ctype), Z_STRLEN_P(ctype), 1); } } else {