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
72
72
public const HTTP_PRECONDITION_REQUIRED = 428 ; // RFC6585
73
73
public const HTTP_TOO_MANY_REQUESTS = 429 ; // RFC6585
74
74
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
76
76
public const HTTP_INTERNAL_SERVER_ERROR = 500 ;
77
77
public const HTTP_NOT_IMPLEMENTED = 501 ;
78
78
public const HTTP_BAD_GATEWAY = 502 ;
Original file line number Diff line number Diff line change @@ -223,7 +223,7 @@ public function save()
223
223
unset($ _SESSION [$ key ]);
224
224
}
225
225
}
226
- if ([$ key = $ this ->metadataBag ->getStorageKey ()] === array_keys ($ _SESSION )) {
226
+ if ($ _SESSION && [$ key = $ this ->metadataBag ->getStorageKey ()] === array_keys ($ _SESSION )) {
227
227
unset($ _SESSION [$ key ]);
228
228
}
229
229
Original file line number Diff line number Diff line change @@ -311,4 +311,13 @@ public function testRegenerateInvalidSessionIdForNativeFileSessionHandler()
311
311
$ this ->assertTrue ($ started );
312
312
$ this ->assertSame ('&~[ ' , session_id ());
313
313
}
314
+
315
+ public function testSaveHandlesNullSessionGracefully ()
316
+ {
317
+ $ storage = $ this ->getStorage ();
318
+ $ _SESSION = null ;
319
+ $ storage ->save ();
320
+
321
+ $ this ->addToAssertionCount (1 );
322
+ }
314
323
}
You can’t perform that action at this time.
0 commit comments