@@ -87,7 +87,7 @@ public function testRefreshToken()
87
87
88
88
$ this ->assertTrue (csrfP_wrapper::checkHeader ('Set-Cookie ' ));
89
89
$ this ->assertTrue (csrfP_wrapper::checkHeader ('csrfp_token ' ));
90
- $ this ->assertTrue (csrfp_wrapper::checkHeader ($ _SESSION [csrfprotector::$ config ['CSRFP_TOKEN ' ]]));
90
+ $ this ->assertTrue (csrfp_wrapper::checkHeader ($ _SESSION [csrfprotector::$ config ['CSRFP_TOKEN ' ]][ 1 ] ));
91
91
}
92
92
93
93
@@ -253,17 +253,11 @@ public function testAuthorisePost_success()
253
253
$ _POST [csrfprotector::$ config ['CSRFP_TOKEN ' ]] = $ _GET [csrfprotector::$ config ['CSRFP_TOKEN ' ]] = $ _SESSION [csrfprotector::$ config ['CSRFP_TOKEN ' ]];
254
254
$ temp = $ _SESSION [csrfprotector::$ config ['CSRFP_TOKEN ' ]];
255
255
256
- $ temp_elem_count = count ($ temp );
257
- $ temp_elems = array ();
258
- foreach ($ temp as $ value ) {
259
- array_push ($ temp_elems , $ value );
260
- }
261
-
262
256
csrfprotector::authorizePost (); //will create new session and cookies
263
257
$ this ->assertFalse ($ temp_elems == $ _SESSION [csrfprotector::$ config ['CSRFP_TOKEN ' ]][0 ]);
264
258
$ this ->assertTrue (csrfp_wrapper::checkHeader ('Set-Cookie ' ));
265
259
$ this ->assertTrue (csrfp_wrapper::checkHeader ('csrfp_token ' ));
266
- $ this ->assertTrue (csrfp_wrapper::checkHeader ($ _SESSION [csrfprotector::$ config ['CSRFP_TOKEN ' ]])); // Combine these 3 later
260
+ $ this ->assertTrue (csrfp_wrapper::checkHeader ($ _SESSION [csrfprotector::$ config ['CSRFP_TOKEN ' ]][ 0 ] )); // Combine these 3 later
267
261
268
262
// For get method
269
263
$ _SERVER ['REQUEST_METHOD ' ] = 'GET ' ;
@@ -272,11 +266,10 @@ public function testAuthorisePost_success()
272
266
$ temp = $ _SESSION [csrfprotector::$ config ['CSRFP_TOKEN ' ]];
273
267
274
268
csrfprotector::authorizePost (); //will create new session and cookies
275
-
276
269
$ this ->assertFalse ($ temp == $ _SESSION [csrfprotector::$ config ['CSRFP_TOKEN ' ]]);
277
270
$ this ->assertTrue (csrfp_wrapper::checkHeader ('Set-Cookie ' ));
278
271
$ this ->assertTrue (csrfp_wrapper::checkHeader ('csrfp_token ' ));
279
- $ this ->assertTrue (csrfp_wrapper::checkHeader ($ _SESSION [csrfprotector::$ config ['CSRFP_TOKEN ' ]])); // Combine these 3 later
272
+ $ this ->assertTrue (csrfp_wrapper::checkHeader ($ _SESSION [csrfprotector::$ config ['CSRFP_TOKEN ' ]][ 0 ] )); // Combine these 3 later
280
273
}
281
274
282
275
/**
0 commit comments