RSS feed not validating
|
moullas
Joined: 2011-11-07
Posts: 9 |
Posted: Wed, 2011-11-09 23:51
|
|
Vanilla installation http://www.40thscouts.org/gallery/ Tried validating the RSS feed, and getting the "pubDate must be an RFC-822 date-time: Thu, 10 Nov 2011 01:42:48 EET" message when running it through W3C validator Strange thing is... Gallery's pubdate gives the following: Only difference is +0200 instead of EET... /Edit/ Btw, I've set the timezone in the advanced configuration as +2 if it matters (don't know if that is valid or not, but it looks like time in Gallery is correct), but the RSS feed in not fixed |
|

Posts: 9
Found the bug.. don't know how to submit the fix properly, so here is the fixes i made in the RSS module:
Hope someone see's this and submits it to code
/modules/rss/controllers/rss.php
Line 53 : Fixes the date to RFC822 compliant, mistake was in the end, T is invalid, O gives GMT offset.
FROM
$view->pub_date = date("D, d M Y H:i:s T");
to
$view->pub_date = date("D, d M Y H:i:s O");
Line 62 : Sets the headers correctly to xml, if you view the source now it is properly formatted XML
FROM
header("Content-Type: application/rss+xml");
TO
header('Content-Type: text/xml; charset=utf-8');
modules/rss/views/feed.mrss.php
Line 28 : Fixes time formatting to RFC822 compliant ("r" formats the date, could also change the date("D, d M Y H:i:s T" to date("D, d M Y H:i:s O")
FROM
<pubDate><?= date("D, d M Y H:i:s T", $item->created); ?></pubDate>
TO
<pubDate><?= date("r", $item->created); ?></pubDate>
Posts: 25961
Thanks for investigating.
I have created https://sourceforge.net/apps/trac/gallery/ticket/1798 so it does not get lost.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 9
Thanks Dave.
I think you can easily test a feed from any other gallery using a Feed Validator.
However, i don't know if i stumbled upon this problem due to how the time is set on my hosting provider, thus showing the problem to me and not to users in other time zones...
Posts: 66
@moullas: Thanks a lot for this fix! Now it validates.
Would be great, if this could be corrected in the gallery-bundle and on gallerymodules.com, since it shipswith the standard installation.
Posts: 25961
Fixed in this commit:
https://github.com/gallery/gallery3/commit/6effd5f75ee6a0972b0fbad5a15c6b7e8bf5ce8e
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team