},
{
"name": "guzzlehttp/psr7",
- "version": "2.4.3",
- "version": "1.9.1",
++ "version": "2.4.5",
"source": {
"type": "git",
"url": "https://github.com/guzzle/psr7.git",
- "reference": "67c26b443f348a51926030c83481b85718457d3d"
- "reference": "e4490cabc77465aaee90b20cfc9a770f8c04be6b"
++ "reference": "0454e12ef0cd597ccd2adb036f7bda4e7fface66"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/guzzle/psr7/zipball/67c26b443f348a51926030c83481b85718457d3d",
- "reference": "67c26b443f348a51926030c83481b85718457d3d",
- "url": "https://api.github.com/repos/guzzle/psr7/zipball/e4490cabc77465aaee90b20cfc9a770f8c04be6b",
- "reference": "e4490cabc77465aaee90b20cfc9a770f8c04be6b",
++ "url": "https://api.github.com/repos/guzzle/psr7/zipball/0454e12ef0cd597ccd2adb036f7bda4e7fface66",
++ "reference": "0454e12ef0cd597ccd2adb036f7bda4e7fface66",
"shasum": ""
},
"require": {
"laminas/laminas-httphandlerrunner": "Emit PSR-7 responses"
},
"type": "library",
- },
- "branch-alias": {
- "dev-master": "2.4-dev"
+ "extra": {
+ "bamarni-bin": {
+ "bin-links": true,
+ "forward-command": false
+ }
+ },
"autoload": {
- "files": [
- "src/functions_include.php"
- ],
"psr-4": {
"GuzzleHttp\\Psr7\\": "src/"
}
],
"support": {
"issues": "https://github.com/guzzle/psr7/issues",
- "source": "https://github.com/guzzle/psr7/tree/2.4.3"
- "source": "https://github.com/guzzle/psr7/tree/1.9.1"
++ "source": "https://github.com/guzzle/psr7/tree/2.4.5"
},
"funding": [
{
"type": "tidelift"
}
],
- "time": "2022-10-26T14:07:24+00:00"
- "time": "2023-04-17T16:00:37+00:00"
++ "time": "2023-04-17T16:00:45+00:00"
},
{
- "name": "paragonie/constant_time_encoding",
- "version": "v2.4.0",
+ "name": "laminas/laminas-diactoros",
+ "version": "2.4.1",
"source": {
"type": "git",
- "url": "https://github.com/paragonie/constant_time_encoding.git",
- "reference": "f34c2b11eb9d2c9318e13540a1dbc2a3afbd939c"
+ "url": "https://github.com/laminas/laminas-diactoros.git",
+ "reference": "36ef09b73e884135d2059cc498c938e90821bb57"
},
"dist": {
"type": "zip",
},
{
"name": "guzzlehttp/psr7",
- "version": "2.4.3",
- "version_normalized": "2.4.3.0",
- "version": "1.9.1",
- "version_normalized": "1.9.1.0",
++ "version": "2.4.5",
++ "version_normalized": "2.4.5.0",
"source": {
"type": "git",
"url": "https://github.com/guzzle/psr7.git",
- "reference": "67c26b443f348a51926030c83481b85718457d3d"
- "reference": "e4490cabc77465aaee90b20cfc9a770f8c04be6b"
++ "reference": "0454e12ef0cd597ccd2adb036f7bda4e7fface66"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/guzzle/psr7/zipball/67c26b443f348a51926030c83481b85718457d3d",
- "reference": "67c26b443f348a51926030c83481b85718457d3d",
- "url": "https://api.github.com/repos/guzzle/psr7/zipball/e4490cabc77465aaee90b20cfc9a770f8c04be6b",
- "reference": "e4490cabc77465aaee90b20cfc9a770f8c04be6b",
++ "url": "https://api.github.com/repos/guzzle/psr7/zipball/0454e12ef0cd597ccd2adb036f7bda4e7fface66",
++ "reference": "0454e12ef0cd597ccd2adb036f7bda4e7fface66",
"shasum": ""
},
"require": {
"suggest": {
"laminas/laminas-httphandlerrunner": "Emit PSR-7 responses"
},
- "time": "2022-10-26T14:07:24+00:00",
- "time": "2023-04-17T16:00:37+00:00",
++ "time": "2023-04-17T16:00:45+00:00",
"type": "library",
- },
- "branch-alias": {
- "dev-master": "2.4-dev"
+ "extra": {
+ "bamarni-bin": {
+ "bin-links": true,
+ "forward-command": false
+ }
+ },
"installation-source": "dist",
"autoload": {
- "files": [
- "src/functions_include.php"
- ],
"psr-4": {
"GuzzleHttp\\Psr7\\": "src/"
}
],
"support": {
"issues": "https://github.com/guzzle/psr7/issues",
- "source": "https://github.com/guzzle/psr7/tree/2.4.3"
- "source": "https://github.com/guzzle/psr7/tree/1.9.1"
++ "source": "https://github.com/guzzle/psr7/tree/2.4.5"
},
"funding": [
{
'dev_requirement' => false,
),
'guzzlehttp/psr7' => array(
- 'pretty_version' => '2.4.3',
- 'version' => '2.4.3.0',
- 'reference' => '67c26b443f348a51926030c83481b85718457d3d',
- 'pretty_version' => '1.9.1',
- 'version' => '1.9.1.0',
- 'reference' => 'e4490cabc77465aaee90b20cfc9a770f8c04be6b',
++ 'pretty_version' => '2.4.5',
++ 'version' => '2.4.5.0',
++ 'reference' => '0454e12ef0cd597ccd2adb036f7bda4e7fface66',
'type' => 'library',
'install_path' => __DIR__ . '/../guzzlehttp/psr7',
'aliases' => array(),
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
-
## Unreleased
-## 1.9.1 - 2023-04-17
++## 2.4.5 - 2023-04-17
+
+ ### Fixed
+
++- Prevent possible warnings on unset variables in `ServerRequest::normalizeNestedFileSpec`
++- Fixed `Message::bodySummary` when `preg_match` fails
+ - Fixed header validation issue
+
-## 1.9.0 - 2022-06-20
++## 2.4.4 - 2023-03-09
++
++### Changed
++
++- Removed the need for `AllowDynamicProperties` in `LazyOpenStream`
++
+## 2.4.3 - 2022-10-26
+
+### Changed
+
+- Replaced `sha1(uniqid())` by `bin2hex(random_bytes(20))`
+
+## 2.4.2 - 2022-10-25
+
+### Fixed
+
+- Fixed erroneous behaviour when combining host and relative path
+
+## 2.4.1 - 2022-08-28
+
+### Fixed
+
+- Rewind body before reading in `Message::bodySummary`
+
+## 2.4.0 - 2022-06-20
### Added
message implementation, several stream decorators, and some helpful
functionality like query string parsing.
+![CI](https://github.com/guzzle/psr7/workflows/CI/badge.svg)
+![Static analysis](https://github.com/guzzle/psr7/workflows/Static%20analysis/badge.svg)
-[![Build Status](https://travis-ci.org/guzzle/psr7.svg?branch=master)](https://travis-ci.org/guzzle/psr7)
++# Installation
++
++```shell
++composer require guzzlehttp/psr7
++```
+
# Stream implementation
This package comes with a number of stream implementations and stream
private $callback;
++ private $stream;
++
public function __construct(StreamInterface $stream, callable $cb)
{
$this->stream = $stream;
"GuzzleHttp\\Tests\\Psr7\\": "tests/"
}
},
- },
- "branch-alias": {
- "dev-master": "2.4-dev"
+ "extra": {
+ "bamarni-bin": {
+ "bin-links": true,
+ "forward-command": false
+ }
+ },
"config": {
- "preferred-install": "dist",
- "sort-packages": true,
"allow-plugins": {
"bamarni/composer-bin-plugin": true
- }
+ },
+ "preferred-install": "dist",
+ "sort-packages": true
}
}
/**
* Lazily reads or writes to a file that is opened only after an IO operation
* take place on the stream.
- *
- * @final
*/
- #[\AllowDynamicProperties]
-class LazyOpenStream implements StreamInterface
+final class LazyOpenStream implements StreamInterface
{
use StreamDecoratorTrait;
/** @var string */
private $mode;
++ /**
++ * @var StreamInterface
++ */
++ private $stream;
++
/**
* @param string $filename File to lazily open
* @param string $mode fopen mode to use when opening the stream
{
$this->filename = $filename;
$this->mode = $mode;
++
++ // unsetting the property forces the first access to go through
++ // __get().
++ unset($this->stream);
}
/**
// Matches any printable character, including unicode characters:
// letters, marks, numbers, punctuation, spacing, and separators.
-- if (preg_match('/[^\pL\pM\pN\pP\pS\pZ\n\r\t]/u', $summary)) {
++ if (preg_match('/[^\pL\pM\pN\pP\pS\pZ\n\r\t]/u', $summary) !== 0) {
return null;
}
));
}
- if (! preg_match('/^[a-zA-Z0-9\'`#$%&*+.^_|~!-]+$/', $header)) {
- if ($header === '') {
- throw new \InvalidArgumentException('Header name can not be empty.');
- }
-
+ if (! preg_match('/^[a-zA-Z0-9\'`#$%&*+.^_|~!-]+$/D', $header)) {
throw new \InvalidArgumentException(
- sprintf(
- '"%s" is not valid header name',
- $header
- )
+ sprintf('"%s" is not valid header name.', $header)
);
}
}
foreach (array_keys($files['tmp_name']) as $key) {
$spec = [
'tmp_name' => $files['tmp_name'][$key],
-- 'size' => $files['size'][$key],
-- 'error' => $files['error'][$key],
-- 'name' => $files['name'][$key],
-- 'type' => $files['type'][$key],
++ 'size' => $files['size'][$key] ?? null,
++ 'error' => $files['error'][$key] ?? null,
++ 'name' => $files['name'][$key] ?? null,
++ 'type' => $files['type'][$key] ?? null,
];
$normalizedFiles[$key] = self::createUploadedFileFromSpec($spec);
}