Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: Some valid date/time strings are not recognized #1478

Closed
itsCryne opened this issue Aug 15, 2024 · 2 comments
Closed

[BUG]: Some valid date/time strings are not recognized #1478

itsCryne opened this issue Aug 15, 2024 · 2 comments
Assignees
Labels
Milestone

Comments

@itsCryne
Copy link

itsCryne commented Aug 15, 2024

Brief description of the issue

RSS Guard fails to recognize a date/time string if (e.g.) the day is only one digit or the timezone is UT although both are permitted by RFC822

How to reproduce the bug?

  1. Add feed: https://gist.github.com/itsCryne/65893359e21d5eaa85e140402abc53bf
  2. Fetch the feed

What was the expected result?

The pubDate of all three items should be shown.

What actually happened?

Only the pubDate of the first item is shown correctly. For the other items, the date/time of the fetch is shown.
image

Debug log

https://gist.github.com/itsCryne/2564a2a65d624626bafa46ae36c79fc7
(l. 372 & 373 show the error)

Operating system and version

RSS Guard

Version: 4.7.3 (built on Linux/x86_64)
Revision: a4e2048-lite
Build date: 7/26/24 4:34 AM
OS: Arch Linux
Qt: 6.7.2 (compiled against 6.7.2)
@itsCryne itsCryne added the Type-Defect This is BUG!!! label Aug 15, 2024
@martinrotter
Copy link
Owner

Perfect, will check these and add support for them

@itsCryne
Copy link
Author

I don't have any experience with Qt and also only limited C++ knowledge but after having a look at the code it seems that we just need to add another line here in textfactory.cpp with

.replace(QSL("UT"), QSL("+0000"))

and add the following lines here

// Commented out patterns are already present

pat << QSL("d MMM yy HH:mm:ss");
pat << QSL("dd MMM yy HH:mm:ss");
pat << QSL("ddd, d MMM yy HH:mm:ss");
//  pat << QSL("ddd, dd MMM yy HH:mm:ss");
pat << QSL("d MMM yy HH:mm");
pat << QSL("dd MMM yy HH:mm");
pat << QSL("ddd, d MMM yy HH:mm");
pat << QSL("ddd, dd MMM yy HH:mm");

// Four digit year
// Not valid per RFC822
// but valid per RFC2822
pat << QSL("d MMM yyyy HH:mm:ss");
pat << QSL("dd MMM yyyy HH:mm:ss");
//  pat << QSL("ddd, d MMM yyyy HH:mm:ss");
//  pat << QSL("ddd, dd MMM yyyy HH:mm:ss");
pat << QSL("d MMM yyyy HH:mm");
pat << QSL("dd MMM yyyy HH:mm");
pat << QSL("ddd, d MMM yyyy HH:mm");
//  pat << QSL("ddd, dd MMM yyyy HH:mm");

If that seems correct, I could also submit a PR with those changes - but I guess it'd be faster/more convenient for you if you make them directly‽

martinrotter added a commit that referenced this issue Aug 20, 2024
@martinrotter martinrotter added this to the 4.7.4 milestone Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants