You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current code suggest that when retrieving the date modified variable it will attempt to create it from 3 different formats: RSS, RFC822 and RFC2822. This doesn't happen because the method used date_create_from_format doesn't throw an exception.
This also means that if the format is not recognised at all the exception won't be thrown.
Current behavior
If the given date doesn't match the first format tested (RSS) the variable will resolve into false and the loop will break there.
How to reproduce
Read an RSS feed with a date modified format different from RSS (D, d M Y H:i:s O).
Expected behavior
The code will iterate over all 3 different formats and if unable to create the datetime object it will throw an exception saying the date format was not recognised.
froschdesign
changed the title
get date modified doesn't iterate over different formats
Method getDateModified of RSS reader doesn't iterate over different formats
Dec 20, 2020
Bug Report
Summary
The current code suggest that when retrieving the date modified variable it will attempt to create it from 3 different formats:
RSS
,RFC822
andRFC2822
. This doesn't happen because the method useddate_create_from_format
doesn't throw an exception.This also means that if the format is not recognised at all the exception won't be thrown.
Current behavior
If the given date doesn't match the first format tested (
RSS
) the variable will resolve into false and the loop will break there.How to reproduce
Read an RSS feed with a date modified format different from
RSS
(D, d M Y H:i:s O
).Expected behavior
The code will iterate over all 3 different formats and if unable to create the datetime object it will throw an exception saying the date format was not recognised.
For reference, the piece of code with the bug:
https://github.com/laminas/laminas-feed/blob/2.13.x/src/Reader/Feed/Rss.php#L205
The text was updated successfully, but these errors were encountered: