Skip to content

Commit 50efe4d

Browse files
committed
Fixed bug in CSRFGuard session checking code.
Before this fix is applied an exception is thrown if the sessions are enabled. An exception should only be thrown if sessions are disabled.
1 parent 5c55089 commit 50efe4d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Middleware/CsrfGuard.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function call() {
5454
*/
5555
public function check() {
5656
// Create token
57-
if ( session_id() === "" ){
57+
if ( session_id() !== "" ){
5858
if ( ! isset( $_SESSION[ $this->key ] ) ){
5959
$_SESSION[ $this->key ] = sha1( serialize( $_SERVER ) . rand( 0, 0xffffffff ) );
6060
}

0 commit comments

Comments
 (0)