File tree Expand file tree Collapse file tree 3 files changed +13
-5
lines changed Expand file tree Collapse file tree 3 files changed +13
-5
lines changed Original file line number Diff line number Diff line change 3
3
- " 5.6"
4
4
- " 5.5"
5
5
- " 5.4"
6
- - " 5.3"
7
6
- " 7.0"
8
7
- " 7.1"
9
8
- hhvm
10
9
- nightly
10
+ - " 5.3"
11
+
11
12
12
13
matrix :
13
14
allow_failures :
14
15
- php : nightly
15
16
- php : hhvm
17
+ - php : " 5.3"
16
18
17
19
os :
18
20
- linux
@@ -43,4 +45,4 @@ after_success:
43
45
cache :
44
46
directories :
45
47
- vendor
46
- - $HOME/.cache/composer
48
+ - $HOME/.cache/composer
Original file line number Diff line number Diff line change @@ -388,11 +388,11 @@ public static function refreshToken()
388
388
if (self ::$ cookieConfig === null ) {
389
389
if (!isset (self ::$ config ['cookieConfig ' ]))
390
390
self ::$ config ['cookieConfig ' ] = array ();
391
-
392
391
self ::$ cookieConfig = new cookieConfig (self ::$ config ['cookieConfig ' ]);
393
392
}
394
393
395
- setcookie (self ::$ config ['CSRFP_TOKEN ' ],
394
+ setcookie (
395
+ self ::$ config ['CSRFP_TOKEN ' ],
396
396
$ token ,
397
397
time () + self ::$ cookieExpiryTime ,
398
398
self ::$ cookieConfig ->path ,
Original file line number Diff line number Diff line change @@ -183,7 +183,13 @@ public function testSecureCookie()
183
183
csrfprotector::refreshToken ();
184
184
$ this ->assertNotRegExp ('/; secure/ ' , csrfp_wrapper::getHeaderValue ('Set-Cookie ' ));
185
185
186
- csrfprotector::$ config ['cookieConfig ' ] = array ('secure ' => true );
186
+ // this one would generally fails, as init was already called and now private static
187
+ // property is set with secure as false;
188
+ $ csrfp = new csrfProtector ;
189
+ $ reflection = new \ReflectionClass (get_class ($ csrfp ));
190
+ $ property = $ reflection ->getProperty ('cookieConfig ' );
191
+ $ property ->setAccessible (true );
192
+ $ property ->setValue ($ csrfp , new cookieConfig (array ('secure ' => true )));
187
193
csrfprotector::refreshToken ();
188
194
$ this ->assertRegExp ('/; secure/ ' , csrfp_wrapper::getHeaderValue ('Set-Cookie ' ));
189
195
}
You can’t perform that action at this time.
0 commit comments