]> granicus.if.org Git - php/commitdiff
Lets play nice and use 4digit years with DATE_RSS
authorHannes Magnusson <bjori@php.net>
Tue, 30 May 2006 15:13:36 +0000 (15:13 +0000)
committerHannes Magnusson <bjori@php.net>
Tue, 30 May 2006 15:13:36 +0000 (15:13 +0000)
ext/date/php_date.c
ext/date/tests/date_constants.phpt

index fca4d48e8b6b832bd5eadd9401c8266fd9dd50d3..c1846f71d6c5e340ef6b9eac9dfede8581fa542c 100644 (file)
@@ -347,10 +347,10 @@ PHP_MINIT_FUNCTION(date)
 
 /*
  * 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);
 /*
@@ -369,9 +369,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);
@@ -1438,7 +1439,7 @@ static void date_register_classes(TSRMLS_D)
        REGISTER_DATE_CLASS_CONST_STRING("RFC1123", DATE_FORMAT_RFC1123);
        REGISTER_DATE_CLASS_CONST_STRING("RFC2822", DATE_FORMAT_RFC2822);
        REGISTER_DATE_CLASS_CONST_STRING("RFC3339", DATE_FORMAT_RFC3339);
-       REGISTER_DATE_CLASS_CONST_STRING("RSS",     DATE_FORMAT_RFC822);
+       REGISTER_DATE_CLASS_CONST_STRING("RSS",     DATE_FORMAT_RFC1123);
        REGISTER_DATE_CLASS_CONST_STRING("W3C",     DATE_FORMAT_RFC3339);
 
 
index 552608f62a07b04ef1c4df57a89a27cc3c966c58..bf11d0bb77463af71619b1e475d61ff0e8d8ec55 100644 (file)
@@ -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"