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 @@ -249,7 +249,7 @@ public function save()
249
249
unset($ _SESSION [$ key ]);
250
250
}
251
251
}
252
- if ([$ key = $ this ->metadataBag ->getStorageKey ()] === array_keys ($ _SESSION )) {
252
+ if ($ _SESSION && [$ key = $ this ->metadataBag ->getStorageKey ()] === array_keys ($ _SESSION )) {
253
253
unset($ _SESSION [$ key ]);
254
254
}
255
255
Original file line number Diff line number Diff line change @@ -314,4 +314,13 @@ public function testRegenerateInvalidSessionIdForNativeFileSessionHandler()
314
314
$ this ->assertTrue ($ started );
315
315
$ this ->assertSame ('&~[ ' , session_id ());
316
316
}
317
+
318
+ public function testSaveHandlesNullSessionGracefully ()
319
+ {
320
+ $ storage = $ this ->getStorage ();
321
+ $ _SESSION = null ;
322
+ $ storage ->save ();
323
+
324
+ $ this ->addToAssertionCount (1 );
325
+ }
317
326
}
You can’t perform that action at this time.
0 commit comments