Zend Framework

Zend_Date::RFC_822 format does not accept four digit years.

Details

  • Type: Patch Patch
  • Status: Resolved Resolved
  • Priority: Minor Minor
  • Resolution: Not an Issue
  • Affects Version/s: 1.8.2
  • Fix Version/s: 1.8.3
  • Component/s: Zend_Date
  • Labels:
    None

Description

When using RFC 822 format Zend_Date throws an exeption when the provided date has the year in four-digit format. RSS specifies that it uses RFC 822 and at the moment most RSS feeds are using four digits for the year e.g. the feeds on http://framework.zend.com. It should be changed to accept 2 or 4 digits.

  1. Date.php
    05/Jun/09 4:56 AM
    178 kB
    Måns Hafrén
  2. diff.txt
    05/Jun/09 5:20 AM
    0.8 kB
    Måns Hafrén

Activity

Hide
Måns Hafrén added a comment -

Line 2259 is changed to accept 2 or 4 digit years.

Show
Måns Hafrén added a comment - Line 2259 is changed to accept 2 or 4 digit years.
Hide
Måns Hafrén added a comment -

svn diff between patch and ZF 1.8.2 Date.php

Show
Måns Hafrén added a comment - svn diff between patch and ZF 1.8.2 Date.php
Hide
Thomas Weidner added a comment -

RFC822 defines that the year value must have 2 digits. 4 digits are not allowed for RFC822.

From the RSS specification at http://cyber.law.harvard.edu/rss/rss.html:
"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)."

This means clearly that the RSS date DOES NOT CONFORM RFC 822.

You should use RSS instead of RFC_822 when you want to detect RSS feed dates.

Show
Thomas Weidner added a comment - RFC822 defines that the year value must have 2 digits. 4 digits are not allowed for RFC822. From the RSS specification at http://cyber.law.harvard.edu/rss/rss.html: "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)." This means clearly that the RSS date DOES NOT CONFORM RFC 822. You should use RSS instead of RFC_822 when you want to detect RSS feed dates.
Hide
Måns Hafrén added a comment -

Thomas, right you are. Then I would like that the reference guide be changed to note this. On the page http://framework.zend.com/manual/en/zend.feed.consuming-rss.html the pubDate is stated to be RFC 822 format. It should be noted that it is actually not and that Zend_Date::RSS should be used.

Show
Måns Hafrén added a comment - Thomas, right you are. Then I would like that the reference guide be changed to note this. On the page http://framework.zend.com/manual/en/zend.feed.consuming-rss.html the pubDate is stated to be RFC 822 format. It should be noted that it is actually not and that Zend_Date::RSS should be used.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: