mirror of
https://github.com/php/php-src.git
synced 2025-08-16 14:08:47 +02:00
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3: Fix #79033: Curl timeout error with specific url and post
This commit is contained in:
commit
6d1dff6f3d
3 changed files with 38 additions and 4 deletions
3
NEWS
3
NEWS
|
@ -17,6 +17,9 @@ PHP NEWS
|
||||||
. Fixed bug #79008 (General performance regression with PHP 7.4 on Windows).
|
. Fixed bug #79008 (General performance regression with PHP 7.4 on Windows).
|
||||||
(cmb)
|
(cmb)
|
||||||
|
|
||||||
|
- CURL:
|
||||||
|
. Fixed bug #79033 (Curl timeout error with specific url and post). (cmb)
|
||||||
|
|
||||||
- Fileinfo:
|
- Fileinfo:
|
||||||
. Fixed bug #74170 (locale information change after mime_content_type).
|
. Fixed bug #74170 (locale information change after mime_content_type).
|
||||||
(Sergei Turchanov)
|
(Sergei Turchanov)
|
||||||
|
|
|
@ -2754,7 +2754,7 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /* {{{
|
||||||
zend_string *string_key;
|
zend_string *string_key;
|
||||||
zend_ulong num_key;
|
zend_ulong num_key;
|
||||||
#if LIBCURL_VERSION_NUM >= 0x073800 /* 7.56.0 */
|
#if LIBCURL_VERSION_NUM >= 0x073800 /* 7.56.0 */
|
||||||
curl_mime *mime;
|
curl_mime *mime = NULL;
|
||||||
curl_mimepart *part;
|
curl_mimepart *part;
|
||||||
CURLcode form_error;
|
CURLcode form_error;
|
||||||
#else
|
#else
|
||||||
|
@ -2769,9 +2769,11 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /* {{{
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LIBCURL_VERSION_NUM >= 0x073800 /* 7.56.0 */
|
#if LIBCURL_VERSION_NUM >= 0x073800 /* 7.56.0 */
|
||||||
mime = curl_mime_init(ch->cp);
|
if (zend_hash_num_elements(postfields) > 0) {
|
||||||
if (mime == NULL) {
|
mime = curl_mime_init(ch->cp);
|
||||||
return FAILURE;
|
if (mime == NULL) {
|
||||||
|
return FAILURE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
29
ext/curl/tests/bug79033.phpt
Normal file
29
ext/curl/tests/bug79033.phpt
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
--TEST--
|
||||||
|
Bug #79033 (Curl timeout error with specific url and post)
|
||||||
|
--SKIPIF--
|
||||||
|
<?php include 'skipif.inc'; ?>
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
include 'server.inc';
|
||||||
|
$host = curl_cli_server_start();
|
||||||
|
$ch = curl_init();
|
||||||
|
curl_setopt_array($ch, [
|
||||||
|
CURLOPT_URL => "{$host}/get.inc?test=post",
|
||||||
|
CURLOPT_POST => true,
|
||||||
|
CURLOPT_POSTFIELDS => [],
|
||||||
|
CURLINFO_HEADER_OUT => true,
|
||||||
|
CURLOPT_RETURNTRANSFER => true,
|
||||||
|
]);
|
||||||
|
var_dump(curl_exec($ch));
|
||||||
|
var_dump(curl_getinfo($ch)["request_header"]);
|
||||||
|
?>
|
||||||
|
--EXPECTF--
|
||||||
|
string(%d) "array(0) {
|
||||||
|
}
|
||||||
|
"
|
||||||
|
string(90) "POST /get.inc?test=post HTTP/1.1
|
||||||
|
Host: localhost:%d
|
||||||
|
Accept: */*
|
||||||
|
Content-Length: 0
|
||||||
|
|
||||||
|
"
|
Loading…
Add table
Add a link
Reference in a new issue