Skip to content

Commit 2bd5bb1

Browse files
committed
Merge branch '4.4' into 5.4
* 4.4: [Mime] Fix invalid DKIM signature with multiple parts Fix Command::run phpdoc Update Response.php [HttpFoundation] Fix TypeError on null `$_SESSION` in `NativeSessionStorage::save()`
2 parents e9cb3d2 + a51316c commit 2bd5bb1

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

Response.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class Response
7272
public const HTTP_PRECONDITION_REQUIRED = 428; // RFC6585
7373
public const HTTP_TOO_MANY_REQUESTS = 429; // RFC6585
7474
public const HTTP_REQUEST_HEADER_FIELDS_TOO_LARGE = 431; // RFC6585
75-
public const HTTP_UNAVAILABLE_FOR_LEGAL_REASONS = 451;
75+
public const HTTP_UNAVAILABLE_FOR_LEGAL_REASONS = 451; // RFC7725
7676
public const HTTP_INTERNAL_SERVER_ERROR = 500;
7777
public const HTTP_NOT_IMPLEMENTED = 501;
7878
public const HTTP_BAD_GATEWAY = 502;

Session/Storage/NativeSessionStorage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ public function save()
249249
unset($_SESSION[$key]);
250250
}
251251
}
252-
if ([$key = $this->metadataBag->getStorageKey()] === array_keys($_SESSION)) {
252+
if ($_SESSION && [$key = $this->metadataBag->getStorageKey()] === array_keys($_SESSION)) {
253253
unset($_SESSION[$key]);
254254
}
255255

Tests/Session/Storage/NativeSessionStorageTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,4 +314,13 @@ public function testRegenerateInvalidSessionIdForNativeFileSessionHandler()
314314
$this->assertTrue($started);
315315
$this->assertSame('&~[', session_id());
316316
}
317+
318+
public function testSaveHandlesNullSessionGracefully()
319+
{
320+
$storage = $this->getStorage();
321+
$_SESSION = null;
322+
$storage->save();
323+
324+
$this->addToAssertionCount(1);
325+
}
317326
}

0 commit comments

Comments
 (0)