Commit 880b2260 authored by Mario's avatar Mario

manualy Fix cURL with HTTP/2 due to merge conflicts

parent 04a2dc07
Pipeline #98590 passed with stage
in 9 minutes and 15 seconds
...@@ -116,13 +116,8 @@ function z_fetch_url($url, $binary = false, $redirects = 0, $opts = array()) { ...@@ -116,13 +116,8 @@ function z_fetch_url($url, $binary = false, $redirects = 0, $opts = array()) {
@curl_setopt($ch, CURLOPT_USERPWD, $opts['http_auth']); @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']); @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')) if(x($opts,'cookiejar'))
@curl_setopt($ch, CURLOPT_COOKIEJAR, $opts['cookiejar']); @curl_setopt($ch, CURLOPT_COOKIEJAR, $opts['cookiejar']);
...@@ -161,7 +156,7 @@ function z_fetch_url($url, $binary = false, $redirects = 0, $opts = array()) { ...@@ -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 // Pull out multiple headers, e.g. proxy and continuation headers
// allow for HTTP/2.x without fixing code // 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); $chunk = substr($base,0,strpos($base,"\r\n\r\n")+4);
$header .= $chunk; $header .= $chunk;
$base = substr($base,strlen($chunk)); $base = substr($base,strlen($chunk));
...@@ -294,12 +289,8 @@ function z_post_url($url, $params, $redirects = 0, $opts = array()) { ...@@ -294,12 +289,8 @@ function z_post_url($url, $params, $redirects = 0, $opts = array()) {
@curl_setopt($ch, CURLOPT_USERPWD, $opts['http_auth']); @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']); @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')) if(x($opts,'cookiejar'))
@curl_setopt($ch, CURLOPT_COOKIEJAR, $opts['cookiejar']); @curl_setopt($ch, CURLOPT_COOKIEJAR, $opts['cookiejar']);
...@@ -333,8 +324,7 @@ function z_post_url($url, $params, $redirects = 0, $opts = array()) { ...@@ -333,8 +324,7 @@ function z_post_url($url, $params, $redirects = 0, $opts = array()) {
// Pull out multiple headers, e.g. proxy and continuation headers // Pull out multiple headers, e.g. proxy and continuation headers
// allow for HTTP/2.x without fixing code // allow for HTTP/2.x without fixing code
while(preg_match('/^HTTP\/[1-3](\.\d)? [1-5][0-9][0-9]/',$base)) {
while(preg_match('/^HTTP\/[1-2].+? [1-5][0-9][0-9]/',$base)) {
$chunk = substr($base,0,strpos($base,"\r\n\r\n")+4); $chunk = substr($base,0,strpos($base,"\r\n\r\n")+4);
$header .= $chunk; $header .= $chunk;
$base = substr($base,strlen($chunk)); $base = substr($base,strlen($chunk));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment