Ticket #110 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

[PATCH] Magpie and PHP 5.1.2 cannot parse times

Reported by: Blair Zajac <blair@orcaware.com> Assigned to: fox
Priority: major Milestone: 1.2.3
Component: backend Version: 1.2.2
Keywords: Cc:

Description

I'm running on Ubuntu Dapper Drake with PHP 5.1.2 and there's a bug in the Magpie parse_w3cdtf() function which converts string dates into Unix timestamps. Here's a proposed fix for it, which I have tested and it works fine.

http://sourceforge.net/mailarchive/message.php?msg_id=15423233

What happens is that the $seconds value in parse_w3cdtf() ends up looking like ':23' and when you hand this off to gmmktime() you end up getting nothing back from it. This doesn't happen with PHP 4.

Could you apply this patch to tiny's local copy of magpierss?

When I try to load this RSS feed

http://bitworking.org/index.atom

all the timestamps end up back in 1969, since the parse_w3cdtf() returns -1.

Thanks, Blair

Change History

09/13/06 00:34:36 changed by fox

  • status changed from new to assigned.
  • milestone set to 1.2.3.

Eh, but is it still PHP4 compatible (can't test right now). Accepted.

09/13/06 00:41:51 changed by Blair Zajac <blair@orcaware.com>

It should be. There's no reason why removing a ':' from what's supposed to be an integer, such as ':23' from $seconds, would break anything.

Blair

09/13/06 00:52:54 changed by www-ttrss

  • status changed from assigned to closed.
  • resolution set to fixed.

(In [1318]) [project @ fix magpie w3cdtf parsing (closes #110)]