Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable26] sec(deps): Update guzzlehttp/psr7 #1387

Merged
merged 3 commits into from
Apr 26, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 8 additions & 11 deletions composer/installed.json
Original file line number Diff line number Diff line change
Expand Up @@ -1564,17 +1564,17 @@
},
{
"name": "guzzlehttp/psr7",
"version": "2.4.3",
"version_normalized": "2.4.3.0",
"version": "2.4.5",
"version_normalized": "2.4.5.0",
"source": {
"type": "git",
"url": "https://github.com/guzzle/psr7.git",
"reference": "67c26b443f348a51926030c83481b85718457d3d"
"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/0454e12ef0cd597ccd2adb036f7bda4e7fface66",
"reference": "0454e12ef0cd597ccd2adb036f7bda4e7fface66",
"shasum": ""
},
"require": {
Expand All @@ -1595,15 +1595,12 @@
"suggest": {
"laminas/laminas-httphandlerrunner": "Emit PSR-7 responses"
},
"time": "2022-10-26T14:07:24+00:00",
"time": "2023-04-17T16:00:45+00:00",
"type": "library",
"extra": {
"bamarni-bin": {
"bin-links": true,
"forward-command": false
},
"branch-alias": {
"dev-master": "2.4-dev"
}
},
"installation-source": "dist",
Expand Down Expand Up @@ -1666,7 +1663,7 @@
],
"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/2.4.5"
},
"funding": [
{
Expand Down Expand Up @@ -7045,6 +7042,6 @@
"install-path": "../web-auth/webauthn-lib"
}
],
"dev": false,
"dev": true,
"dev-package-names": []
}
12 changes: 6 additions & 6 deletions composer/installed.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
'name' => 'nextcloud/3rdparty',
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'reference' => '7290f9d6d76016c7a6c06f0e58a780101df3fc41',
'reference' => '0ec73636ee36558960a1df60828b645ef3d4a53c',
'type' => 'library',
'install_path' => __DIR__ . '/../',
'aliases' => array(),
'dev' => false,
'dev' => true,
),
'versions' => array(
'aws/aws-crt-php' => array(
Expand Down Expand Up @@ -209,9 +209,9 @@
'dev_requirement' => false,
),
'guzzlehttp/psr7' => array(
'pretty_version' => '2.4.3',
'version' => '2.4.3.0',
'reference' => '67c26b443f348a51926030c83481b85718457d3d',
'pretty_version' => '2.4.5',
'version' => '2.4.5.0',
'reference' => '0454e12ef0cd597ccd2adb036f7bda4e7fface66',
'type' => 'library',
'install_path' => __DIR__ . '/../guzzlehttp/psr7',
'aliases' => array(),
Expand Down Expand Up @@ -328,7 +328,7 @@
'nextcloud/3rdparty' => array(
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'reference' => '7290f9d6d76016c7a6c06f0e58a780101df3fc41',
'reference' => '0ec73636ee36558960a1df60828b645ef3d4a53c',
'type' => 'library',
'install_path' => __DIR__ . '/../',
'aliases' => array(),
Expand Down
10 changes: 9 additions & 1 deletion guzzlehttp/psr7/src/LazyOpenStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
* Lazily reads or writes to a file that is opened only after an IO operation
* take place on the stream.
*/
#[\AllowDynamicProperties]
final class LazyOpenStream implements StreamInterface
{
use StreamDecoratorTrait;
Expand All @@ -21,6 +20,11 @@ final class LazyOpenStream implements StreamInterface
/** @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
Expand All @@ -29,6 +33,10 @@ public function __construct(string $filename, string $mode)
{
$this->filename = $filename;
$this->mode = $mode;

// unsetting the property forces the first access to go through
// __get().
unset($this->stream);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion guzzlehttp/psr7/src/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public static function bodySummary(MessageInterface $message, int $truncateAt =

// 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;
}

Expand Down
13 changes: 6 additions & 7 deletions guzzlehttp/psr7/src/MessageTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -224,12 +224,9 @@ private function assertHeader($header): void
));
}

if (! preg_match('/^[a-zA-Z0-9\'`#$%&*+.^_|~!-]+$/', $header)) {
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)
);
}
}
Expand Down Expand Up @@ -257,8 +254,10 @@ private function assertValue(string $value): void
// Clients must not send a request with line folding and a server sending folded headers is
// likely very rare. Line folding is a fairly obscure feature of HTTP/1.1 and thus not accepting
// folding is not likely to break any legitimate use case.
if (! preg_match('/^[\x20\x09\x21-\x7E\x80-\xFF]*$/', $value)) {
throw new \InvalidArgumentException(sprintf('"%s" is not valid header value', $value));
if (! preg_match('/^[\x20\x09\x21-\x7E\x80-\xFF]*$/D', $value)) {
throw new \InvalidArgumentException(
sprintf('"%s" is not valid header value.', $value)
);
}
}
}
8 changes: 4 additions & 4 deletions guzzlehttp/psr7/src/ServerRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,10 @@ private static function normalizeNestedFileSpec(array $files = []): array
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);
}
Expand Down