File tree Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Original file line number Diff line number Diff 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 ;
Original file line number Diff line number Diff line change @@ -223,7 +223,7 @@ public function save()
223223 unset($ _SESSION [$ key ]);
224224 }
225225 }
226- if ([$ key = $ this ->metadataBag ->getStorageKey ()] === array_keys ($ _SESSION )) {
226+ if ($ _SESSION && [$ key = $ this ->metadataBag ->getStorageKey ()] === array_keys ($ _SESSION )) {
227227 unset($ _SESSION [$ key ]);
228228 }
229229
Original file line number Diff line number Diff line change @@ -311,4 +311,13 @@ public function testRegenerateInvalidSessionIdForNativeFileSessionHandler()
311311 $ this ->assertTrue ($ started );
312312 $ this ->assertSame ('&~[ ' , session_id ());
313313 }
314+
315+ public function testSaveHandlesNullSessionGracefully ()
316+ {
317+ $ storage = $ this ->getStorage ();
318+ $ _SESSION = null ;
319+ $ storage ->save ();
320+
321+ $ this ->addToAssertionCount (1 );
322+ }
314323}
You can’t perform that action at this time.
0 commit comments