manualy Fix cURL with HTTP/2 due to merge conflicts
This commit is contained in:
parent
04a2dc075f
commit
880b22604b
@ -116,13 +116,8 @@ function z_fetch_url($url, $binary = false, $redirects = 0, $opts = array()) {
|
||||
@curl_setopt($ch, CURLOPT_USERPWD, $opts['http_auth']);
|
||||
}
|
||||
|
||||
if(array_key_exists('http_version',$opts)) {
|
||||
if(array_key_exists('http_version',$opts))
|
||||
@curl_setopt($ch,CURLOPT_HTTP_VERSION,$opts['http_version']);
|
||||
}
|
||||
else {
|
||||
@curl_setopt($ch,CURLOPT_HTTP_VERSION,CURL_HTTP_VERSION_1_1);
|
||||
}
|
||||
|
||||
|
||||
if(x($opts,'cookiejar'))
|
||||
@curl_setopt($ch, CURLOPT_COOKIEJAR, $opts['cookiejar']);
|
||||
@ -161,7 +156,7 @@ function z_fetch_url($url, $binary = false, $redirects = 0, $opts = array()) {
|
||||
// Pull out multiple headers, e.g. proxy and continuation headers
|
||||
// allow for HTTP/2.x without fixing code
|
||||
|
||||
while(preg_match('/^HTTP\/[1-2].+? [1-5][0-9][0-9]/',$base)) {
|
||||
while(preg_match('/^HTTP\/[1-3](\.\d)? [1-5][0-9][0-9]/',$base)) {
|
||||
$chunk = substr($base,0,strpos($base,"\r\n\r\n")+4);
|
||||
$header .= $chunk;
|
||||
$base = substr($base,strlen($chunk));
|
||||
@ -294,12 +289,8 @@ function z_post_url($url, $params, $redirects = 0, $opts = array()) {
|
||||
@curl_setopt($ch, CURLOPT_USERPWD, $opts['http_auth']);
|
||||
}
|
||||
|
||||
if(array_key_exists('http_version',$opts)) {
|
||||
if(array_key_exists('http_version',$opts))
|
||||
@curl_setopt($ch,CURLOPT_HTTP_VERSION,$opts['http_version']);
|
||||
}
|
||||
else {
|
||||
@curl_setopt($ch,CURLOPT_HTTP_VERSION,CURL_HTTP_VERSION_1_1);
|
||||
}
|
||||
|
||||
if(x($opts,'cookiejar'))
|
||||
@curl_setopt($ch, CURLOPT_COOKIEJAR, $opts['cookiejar']);
|
||||
@ -333,8 +324,7 @@ function z_post_url($url, $params, $redirects = 0, $opts = array()) {
|
||||
|
||||
// Pull out multiple headers, e.g. proxy and continuation headers
|
||||
// allow for HTTP/2.x without fixing code
|
||||
|
||||
while(preg_match('/^HTTP\/[1-2].+? [1-5][0-9][0-9]/',$base)) {
|
||||
while(preg_match('/^HTTP\/[1-3](\.\d)? [1-5][0-9][0-9]/',$base)) {
|
||||
$chunk = substr($base,0,strpos($base,"\r\n\r\n")+4);
|
||||
$header .= $chunk;
|
||||
$base = substr($base,strlen($chunk));
|
||||
|
Reference in New Issue
Block a user