diff options
Diffstat (limited to 'vendor/sabre/http/lib')
-rw-r--r-- | vendor/sabre/http/lib/Client.php | 7 | ||||
-rw-r--r-- | vendor/sabre/http/lib/Message.php | 2 | ||||
-rw-r--r-- | vendor/sabre/http/lib/Response.php | 2 | ||||
-rw-r--r-- | vendor/sabre/http/lib/Sapi.php | 1 | ||||
-rw-r--r-- | vendor/sabre/http/lib/Version.php | 2 | ||||
-rw-r--r-- | vendor/sabre/http/lib/functions.php | 4 |
6 files changed, 12 insertions, 6 deletions
diff --git a/vendor/sabre/http/lib/Client.php b/vendor/sabre/http/lib/Client.php index b79c564da..99ffcf8cb 100644 --- a/vendor/sabre/http/lib/Client.php +++ b/vendor/sabre/http/lib/Client.php @@ -376,11 +376,16 @@ class Client extends EventEmitter default: $body = $request->getBody(); if (is_resource($body)) { + $bodyStat = fstat($body); + // This needs to be set to PUT, regardless of the actual // method used. Without it, INFILE will be ignored for some // reason. $settings[CURLOPT_PUT] = true; - $settings[CURLOPT_INFILE] = $request->getBody(); + $settings[CURLOPT_INFILE] = $body; + if (false !== $bodyStat && array_key_exists('size', $bodyStat)) { + $settings[CURLOPT_INFILESIZE] = $bodyStat['size']; + } } else { // For security we cast this to a string. If somehow an array could // be passed here, it would be possible for an attacker to use @ to diff --git a/vendor/sabre/http/lib/Message.php b/vendor/sabre/http/lib/Message.php index 90153fda5..6474f38d2 100644 --- a/vendor/sabre/http/lib/Message.php +++ b/vendor/sabre/http/lib/Message.php @@ -88,7 +88,7 @@ abstract class Message implements MessageInterface * @var string|int|null */ $contentLength = $this->getHeader('Content-Length'); - if (is_int($contentLength) || ctype_digit($contentLength)) { + if (null !== $contentLength && (is_int($contentLength) || ctype_digit($contentLength))) { return stream_get_contents($body, (int) $contentLength); } diff --git a/vendor/sabre/http/lib/Response.php b/vendor/sabre/http/lib/Response.php index 64dfbc0b2..2369bb41e 100644 --- a/vendor/sabre/http/lib/Response.php +++ b/vendor/sabre/http/lib/Response.php @@ -149,7 +149,7 @@ class Response extends Message implements ResponseInterface */ public function setStatus($status) { - if (ctype_digit($status) || is_int($status)) { + if (is_int($status) || ctype_digit($status)) { $statusCode = $status; $statusText = self::$statusCodes[$status] ?? 'Unknown'; } else { diff --git a/vendor/sabre/http/lib/Sapi.php b/vendor/sabre/http/lib/Sapi.php index 73674a5a1..823d5df25 100644 --- a/vendor/sabre/http/lib/Sapi.php +++ b/vendor/sabre/http/lib/Sapi.php @@ -154,6 +154,7 @@ class Sapi $hostName = 'localhost'; foreach ($serverArray as $key => $value) { + $key = (string) $key; switch ($key) { case 'SERVER_PROTOCOL': if ('HTTP/1.0' === $value) { diff --git a/vendor/sabre/http/lib/Version.php b/vendor/sabre/http/lib/Version.php index 624e2a78e..f182979c6 100644 --- a/vendor/sabre/http/lib/Version.php +++ b/vendor/sabre/http/lib/Version.php @@ -16,5 +16,5 @@ class Version /** * Full version number. */ - const VERSION = '5.1.1'; + const VERSION = '5.1.3'; } diff --git a/vendor/sabre/http/lib/functions.php b/vendor/sabre/http/lib/functions.php index a23840a1a..97673da46 100644 --- a/vendor/sabre/http/lib/functions.php +++ b/vendor/sabre/http/lib/functions.php @@ -331,8 +331,8 @@ function parseMimeType(string $str): array if (2 !== count($mimeType)) { // Illegal value var_dump($mimeType); - die(); - throw new InvalidArgumentException('Not a valid mime-type: '.$str); + exit(); + // throw new InvalidArgumentException('Not a valid mime-type: '.$str); } list($type, $subType) = $mimeType; |