aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2018-12-22 20:17:20 +0100
committerMario <mario@mariovavti.com>2018-12-22 20:17:20 +0100
commit880b22604badd278a5aff92fff499eb96d0c060a (patch)
tree0a05c6086a8290909af3644974c75b205a33e102 /include
parent04a2dc075f23a5fafba1f1ce74e49ece98ea73e0 (diff)
downloadvolse-hubzilla-880b22604badd278a5aff92fff499eb96d0c060a.tar.gz
volse-hubzilla-880b22604badd278a5aff92fff499eb96d0c060a.tar.bz2
volse-hubzilla-880b22604badd278a5aff92fff499eb96d0c060a.zip
manualy Fix cURL with HTTP/2 due to merge conflicts
Diffstat (limited to 'include')
-rw-r--r--include/network.php18
1 files changed, 4 insertions, 14 deletions
diff --git a/include/network.php b/include/network.php
index 5f45d8eb8..63fe9d9c4 100644
--- a/include/network.php
+++ b/include/network.php
@@ -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));