Package: libxml-feedpp-perl
Version: 0.34-1
Severity: normal
File: /usr/share/perl5/XML/FeedPP.pm
Tags: patch

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

My program using XML::FeedPP just crashed trying to get a unix
timestamp:

[1044] Cannot handle date (16, 27, 22, 20, 9, 8) at 
/usr/share/perl5/XML/FeedPP.pm line 2246
[1044]  at /usr/share/perl/5.10/Time/Local.pm line 131
[1044]  Time::Local::timegm(16, 27, 22, 20, 9, -1892) called at 
/usr/share/perl5/XML/FeedPP.pm line 2246
[1044]  XML::FeedPP::Util::rfc1123_to_epoch('Mon, 20 Oct 08 22:27:16 -0700') 
called at /usr/share/perl5/XML/FeedPP.pm line 2312
[1044]  XML::FeedPP::Util::get_epoch('Mon, 20 Oct 08 22:27:16 -0700') called at 
/usr/share/perl5/XML/FeedPP.pm line 682
[1044]  
XML::FeedPP::get_pubDate_epoch('XML::FeedPP::RSS::Item=HASH(0x35d3bf0)') called 
at ./Podist line 173
[1044]  main::fetch() called at ./Podist line 101
[1044]  main::catch() called at ./Podist line 63
[1044]  main::go() called at ./Podist line 45

The problem is that the feed uses a two-digit year. RFC1123 allows that
(though recommends a four-digit). Here is a patch to fix.

I am considering two-digit years to mean a range of 1977 through 2076; I
have picked this range as (a) I can't find a standard way to do it in
RFC1123, RFC822, or RFC733 and (b) 1977 is the year RFC773 (which seems
to have introduced this silly format) was written.

- --- FeedPP.pm.old       2008-10-23 23:11:14.000000000 -0400
+++ FeedPP.pm   2008-10-23 23:24:07.000000000 -0400
@@ -2242,6 +2242,8 @@
     return unless defined $str;
     my ( $mday, $mon, $year, $hour, $min, $sec, $tz ) = ( $str =~ 
$rfc1123_regexp );
     return unless ( $year && $mon && $mday );
+    $year += 2000 if $year < 77;
+    $year += 1900 if $year < 100;
     $mon = $MoY{ uc($mon) } or return;
     my $epoch = Time::Local::timegm( $sec, $min, $hour, $mday, $mon-1, 
$year-1900 );
     $epoch -= &get_tz_offset( $tz );


- -- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (500, 'testing'), (500, 'stable'), (130, 'unstable'), (120, 
'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.26-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages libxml-feedpp-perl depends on:
ii  libxml-treepp-perl            0.33-1.1   XML::TreePP -- Pure Perl implement
ii  perl                          5.10.0-15  Larry Wall's Practical Extraction 

libxml-feedpp-perl recommends no packages.

libxml-feedpp-perl suggests no packages.

- -- no debconf information

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkkBQM0ACgkQ+z+IwlXqWf55mACgjNhGf5N0nUF22ZQN7VlBXyIl
ibAAn2raY2TUXOOo5OThp5t8LU9UQnXd
=NrCI
-----END PGP SIGNATURE-----



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to