Skip to content

Commit 9d8f97d

Browse files
committed
Revert "Fix DATE_FORMAT_COOKIE definition"
This reverts commit ac34648. As pointed out on GH-6783, the new format doesn't match any of the specified formats. Previously the constant generated Thursday, 14-Jul-2005 22:30:41 BST which is obsolete. Now it generates Thu, 14-Jul-2005 22:30:41 BST which is not specified at all. The correct version would be: Thu, 14 Jul 2005 22:30:41 BST Reverting the change for now.
1 parent 70545b7 commit 9d8f97d

7 files changed

+9
-13
lines changed

UPGRADING

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@ PHP 8.2 UPGRADE NOTES
1919
1. Backward Incompatible Changes
2020
========================================
2121

22-
- Datetime:
23-
. DateTime::COOKIE has been changed from "l, d-M-Y H:i:s T" to
24-
"D, d-M-Y H:i:s T" in line with IETF RFC 7234 section 5.3.
25-
2622
========================================
2723
2. New Features
2824
========================================

ext/date/php_date.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ ZEND_MODULE_POST_ZEND_DEACTIVATE_D(date)
375375
* http://msdn.microsoft.com/en-us/library/windows/desktop/aa384321%28v=vs.85%29.aspx
376376
* and http://curl.haxx.se/rfc/cookie_spec.html
377377
*/
378-
#define DATE_FORMAT_COOKIE "D, d-M-Y H:i:s T"
378+
#define DATE_FORMAT_COOKIE "l, d-M-Y H:i:s T"
379379

380380
#define SUNFUNCS_RET_TIMESTAMP 0
381381
#define SUNFUNCS_RET_STRING 1

ext/date/tests/DateTime_format_basic2.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ var_dump( $date->format( DateTime::W3C) ) ;
2424
--EXPECT--
2525
*** Testing date_format() : basic functionality - formatting coinstants ***
2626
string(25) "2005-07-14T22:30:41+01:00"
27-
string(29) "Thu, 14-Jul-2005 22:30:41 BST"
27+
string(34) "Thursday, 14-Jul-2005 22:30:41 BST"
2828
string(24) "2005-07-14T22:30:41+0100"
2929
string(29) "Thu, 14 Jul 05 22:30:41 +0100"
3030
string(32) "Thursday, 14-Jul-05 22:30:41 BST"

ext/date/tests/bug52063.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ echo $a->format(DateTime::COOKIE);
1111
echo "\n";
1212
?>
1313
--EXPECT--
14-
Thu, 01-Jan-2009 00:00:00 WET
15-
Thu, 01-Jan-2009 00:00:00 WET
14+
Thursday, 01-Jan-2009 00:00:00 WET
15+
Thursday, 01-Jan-2009 00:00:00 WET

ext/date/tests/date_constants.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ Date constants
4141
--EXPECT--
4242
string(25) "2006-07-01T14:27:30+02:00"
4343
string(25) "2006-05-30T14:32:13+02:00"
44-
string(30) "Sat, 01-Jul-2006 14:27:30 CEST"
45-
string(30) "Tue, 30-May-2006 14:32:13 CEST"
44+
string(35) "Saturday, 01-Jul-2006 14:27:30 CEST"
45+
string(34) "Tuesday, 30-May-2006 14:32:13 CEST"
4646
string(24) "2006-07-01T14:27:30+0200"
4747
string(24) "2006-05-30T14:32:13+0200"
4848
string(29) "Sat, 01 Jul 06 14:27:30 +0200"

ext/date/tests/gmdate_variation13.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ string(25) "2008-08-08T08:08:08+00:00"
3939
string(%d) "%s"
4040

4141
--DATE_COOKIE Constant--
42-
string(29) "Fri, 08-Aug-2008 08:08:08 GMT"
42+
string(32) "Friday, 08-Aug-2008 08:08:08 GMT"
4343
string(%d) "%s"
4444

4545
--DATE_RFC822 Constant--

ext/date/tests/test-parse-from-format.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ object(DateTime)#2 (3) {
3232
string(6) "+02:00"
3333
}
3434

35-
string(16) "D, d-M-Y H:i:s T"
36-
string(34) "Tue, 08-Jul-2008 22:14:12 GMT+0200"
35+
string(16) "l, d-M-Y H:i:s T"
36+
string(38) "Tuesday, 08-Jul-2008 22:14:12 GMT+0200"
3737
object(DateTime)#1 (3) {
3838
["date"]=>
3939
string(26) "2008-07-08 22:14:12.000000"

0 commit comments

Comments
 (0)