WordPress.org

Forums

Bug in wp-rss*.php, handling GMT offset (12 posts)

  1. alt-os
    Member
    Posted 10 years ago #

    I actually noticed that rss feeds doesn't care about the "GMT offset" set in the admin panel. The offset is statically +000, and that cause some problem when the feed is handled by software, because GMT is assumed +000.
    I made a patch for this, just changing the whole date string, with the 'r' parameter that since php 4.0.4, output the correctly formatted RFC date.

    The patch is available there: http://www.free-os.it/Downloads/wp.patch

  2. jowra
    Member
    Posted 10 years ago #

    How can I apply this? Is it possible to post the whole new wp-rss.php?

  3. alt-os
    Member
    Posted 10 years ago #

    Just replace the string
    'D, d M Y H:i:s +0000'
    in the mysql2date function with a
    'r'

    The same should be done with wp-rss2.php, and the change must be done twice, at lines 24 and 33

    (in any case, you apply the patch with the command "patch -p0 < wp.patch" in the /directory)

  4. jowra
    Member
    Posted 10 years ago #

    Thanks a lot, alt-os!

  5. alt-os
    Member
    Posted 10 years ago #

    This bug is still not fixed on last released 1.5.1. Who have I to write to??

  6. Dougal Campbell
    Member
    Posted 10 years ago #

    Can you be more specific about what the real problem is?

    We're sending out a timestamp in GMT rather than in local time, but as far as I can tell, we're sending out the *correct* timetamp... Is that not the case?

  7. This bug is still not fixed on last released 1.5.1. Who have I to write to??

    http://codex.wordpress.org/Submitting_Bugs

  8. mkgago
    Member
    Posted 10 years ago #

    alt-os, you rock--I really hope this works. I've been struggling with this problem lately.

    Thanks so much for this.

  9. Ryan Boren
    WordPress Dev
    Posted 10 years ago #

    I'm with dougal, I don't see a problem with regard to 1.5.1. We're sending out the time in UTC, and the time seems to be correct. The patches mentioned in this thread are for 1.5, not 1.5.1.

  10. mkgago
    Member
    Posted 10 years ago #

    You're right, ryan--I am using 1.5.

    But just for the record, alt-os, the patch outputs the pubdate as one hour earlier than the actual post date (I'm on EST time). Is there a way to fix that?

  11. alt-os
    Member
    Posted 10 years ago #

    I'll try to explain the problem I met in a better way (sorry for my english :/).
    I live in Europe (Italy), and for that reason, my clock is set 2 hours more than the GMT (1 hour is for the Dayloght saving time).

    I had some problems because the rss aggregator my blog was subscribed to, aggregated my posts as if they where been written 2 hours before the real date. But the blog homepage reported the correct time, so I went reading in the code, beginning from wp-rss2.php. There, I found that the "GMT offset" (+0000, +0200) part of the date reported in the feed, was static. Once I changed the date string, using the 'r' parameter of date() (that actually give the same output, but with the gmt offset, working directly on the date settings of the server), and everything went fine.
    I've not check if the problem still in 1.5.1, because I patched the two files before trying it... :/

  12. alt-os
    Member
    Posted 9 years ago #

    Still not be changed. What the problem with the +r option of date(), instead of the "manual" way wordpress is using?
    That's just causing problems!

Topic Closed

This topic has been closed to new replies.

About this Topic