Skip to content

Commit 933b4cb

Browse files
committed
Merge branch '5.2' into 5.x
* 5.2: [Workflow] Re-add InvalidTokenConfigurationException for BC Fix PHP 8.1 null values [Console] Fix PHP 8.1 null error for preg_match flag Fix: Article Definition::removeMethodCall should remove all matching calls [HttpFoundation] Fix typo in exception message mark the LazyIterator class as internal fix extracting mixed type-hinted property types [Worflow] Fixed GuardListener when using the new Security system keep valid submitted choices when additional choices are submitted
2 parents 8847c67 + 3f5ec5d commit 933b4cb

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

HeaderUtils.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ public static function unquote(string $s): string
146146
}
147147

148148
/**
149-
* Generates a HTTP Content-Disposition field-value.
149+
* Generates an HTTP Content-Disposition field-value.
150150
*
151151
* @param string $disposition One of "inline" or "attachment"
152152
* @param string $filename A unicode string

Request.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1574,7 +1574,7 @@ public function getContent(bool $asResource = false)
15741574
public function toArray()
15751575
{
15761576
if ('' === $content = $this->getContent()) {
1577-
throw new JsonException('Response body is empty.');
1577+
throw new JsonException('Request body is empty.');
15781578
}
15791579

15801580
try {
@@ -1753,7 +1753,7 @@ public function getAcceptableContentTypes()
17531753
}
17541754

17551755
/**
1756-
* Returns true if the request is a XMLHttpRequest.
1756+
* Returns true if the request is an XMLHttpRequest.
17571757
*
17581758
* It works if your JavaScript library sets an X-Requested-With HTTP header.
17591759
* It is known to work with common JavaScript frameworks:

Response.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1264,7 +1264,7 @@ public function setContentSafe(bool $safe = true): void
12641264
*/
12651265
protected function ensureIEOverSSLCompatibility(Request $request): void
12661266
{
1267-
if (false !== stripos($this->headers->get('Content-Disposition'), 'attachment') && 1 == preg_match('/MSIE (.*?);/i', $request->server->get('HTTP_USER_AGENT'), $match) && true === $request->isSecure()) {
1267+
if (false !== stripos($this->headers->get('Content-Disposition') ?? '', 'attachment') && 1 == preg_match('/MSIE (.*?);/i', $request->server->get('HTTP_USER_AGENT') ?? '', $match) && true === $request->isSecure()) {
12681268
if ((int) preg_replace('/(MSIE )(.*?);/', '$2', $match[0]) < 9) {
12691269
$this->headers->remove('Cache-Control');
12701270
}

Tests/RequestTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -805,7 +805,7 @@ public function getQueryStringNormalizationData()
805805
['bar=&foo=bar', 'bar=&foo=bar', '->works with empty parameters'],
806806
['foo=bar&bar=', 'bar=&foo=bar', 'sorts keys alphabetically'],
807807

808-
// GET parameters, that are submitted from a HTML form, encode spaces as "+" by default (as defined in enctype application/x-www-form-urlencoded).
808+
// GET parameters, that are submitted from an HTML form, encode spaces as "+" by default (as defined in enctype application/x-www-form-urlencoded).
809809
// PHP also converts "+" to spaces when filling the global _GET or when using the function parse_str.
810810
['baz=Foo%20Baz&bar=Foo+Bar', 'bar=Foo%20Bar&baz=Foo%20Baz', 'normalizes spaces in both encodings "%20" and "+"'],
811811

@@ -1260,7 +1260,7 @@ public function testToArrayEmpty()
12601260
{
12611261
$req = new Request();
12621262
$this->expectException(JsonException::class);
1263-
$this->expectExceptionMessage('Response body is empty.');
1263+
$this->expectExceptionMessage('Request body is empty.');
12641264
$req->toArray();
12651265
}
12661266

0 commit comments

Comments
 (0)