Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit76e7e3b

Browse files
adammeyerodanakrabat
authored
Correct cookie expiration date format (#336)
* correct date format for cookie expire* use GMT instead of UTC* Update test for correctly formatted date---------Co-authored-by: Daniel Opitz <odan@users.noreply.github.com>Co-authored-by: Rob Allen <rob@akrabat.com>
1 parent3b2fb2a commit76e7e3b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

‎src/Cookies.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ protected function toHeader(string $name, array $properties): string
148148
$timestamp = (int)$properties['expires'];
149149
}
150150
if ($timestamp &&$timestamp !==0) {
151-
$result .='; expires=' .gmdate('D, d-M-Y H:i:s e',$timestamp);
151+
$result .='; expires=' .gmdate('D, d MY H:i:s',$timestamp) .' GMT';
152152
}
153153
}
154154

‎tests/CookiesTest.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ public function testToHeader()
242242
]
243243
];
244244
$time =time();
245-
$formattedDate =gmdate('D, d-M-Y H:i:se',$time);
245+
$formattedDate =gmdate('D, d MY H:i:s\G\M\T',$time);
246246
$propertiesComplex = [
247247
'name' =>'test_complex',
248248
'properties' => [
@@ -257,7 +257,7 @@ public function testToHeader()
257257
]
258258
];
259259
$stringDate ='2016-01-01 12:00:00';
260-
$formattedStringDate =gmdate('D, d-M-Y H:i:se',strtotime($stringDate));
260+
$formattedStringDate =gmdate('D, d MY H:i:s\G\M\T',strtotime($stringDate));
261261
$propertiesStringDate = [
262262
'name' =>'test_date',
263263
'properties' => [

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp