From 91d4ef33efacfca82403dcb28361db9275c9af95 Mon Sep 17 00:00:00 2001 From: Hannes Magnusson Date: Tue, 30 May 2006 15:14:22 +0000 Subject: [PATCH] MFH: Play nice, use 4digit years in DATE_RSS --- ext/date/php_date.c | 13 +++++++------ ext/date/tests/date_constants.phpt | 4 ++-- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/ext/date/php_date.c b/ext/date/php_date.c index 178a3209c4..8d8b2a1d81 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -341,10 +341,10 @@ PHP_MINIT_FUNCTION(date) #endif /* * RFC4287, Section 3.3: http://www.ietf.org/rfc/rfc4287.txt - * A Date construct is an element whose content MUST conform to the - * "date-time" production in [RFC3339]. In addition, an uppercase "T" - * character MUST be used to separate date and time, and an uppercase - * "Z" character MUST be present in the absence of a numeric time zone offset. + * A Date construct is an element whose content MUST conform to the + * "date-time" production in [RFC3339]. In addition, an uppercase "T" + * character MUST be used to separate date and time, and an uppercase + * "Z" character MUST be present in the absence of a numeric time zone offset. */ REGISTER_STRING_CONSTANT("DATE_ATOM", DATE_FORMAT_RFC3339, CONST_CS | CONST_PERSISTENT); /* @@ -363,9 +363,10 @@ PHP_MINIT_FUNCTION(date) REGISTER_STRING_CONSTANT("DATE_RFC3339", DATE_FORMAT_RFC3339, CONST_CS | CONST_PERSISTENT); /* * RSS 2.0 Specification: http://blogs.law.harvard.edu/tech/rss - * "All date-times in RSS conform to the Date and Time Specification of RFC 822" + * "All date-times in RSS conform to the Date and Time Specification of RFC 822, + * with the exception that the year may be expressed with two characters or four characters (four preferred)" */ - REGISTER_STRING_CONSTANT("DATE_RSS", DATE_FORMAT_RFC822, CONST_CS | CONST_PERSISTENT); + REGISTER_STRING_CONSTANT("DATE_RSS", DATE_FORMAT_RFC1123, CONST_CS | CONST_PERSISTENT); REGISTER_STRING_CONSTANT("DATE_W3C", DATE_FORMAT_RFC3339, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("SUNFUNCS_RET_TIMESTAMP", SUNFUNCS_RET_TIMESTAMP, CONST_CS | CONST_PERSISTENT); diff --git a/ext/date/tests/date_constants.phpt b/ext/date/tests/date_constants.phpt index 552608f62a..bf11d0bb77 100644 --- a/ext/date/tests/date_constants.phpt +++ b/ext/date/tests/date_constants.phpt @@ -38,7 +38,7 @@ string(31) "Sat, 01 Jul 2006 14:27:30 +0200" string(31) "Tue, 30 May 2006 14:32:13 +0200" string(31) "Sat, 01 Jul 2006 14:27:30 +0200" string(31) "Tue, 30 May 2006 14:32:13 +0200" -string(29) "Sat, 01 Jul 06 14:27:30 +0200" -string(29) "Tue, 30 May 06 14:32:13 +0200" +string(31) "Sat, 01 Jul 2006 14:27:30 +0200" +string(31) "Tue, 30 May 2006 14:32:13 +0200" string(25) "2006-07-01T14:27:30+02:00" string(25) "2006-05-30T14:32:13+02:00" -- 2.50.1