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

timelocal should be called with 4-digit year [rt.cpan.org #124528] #5

Closed
plicease opened this issue Sep 29, 2020 · 3 comments
Closed
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@plicease
Copy link
Member

https://rt.cpan.org/Ticket/Display.html?id=124528

man Time::Local says

 Whenever possible, use an absolute four digit year instead.

With a detailed explanation about ambiguity of 2-digit years above that.

Please review/test/merge the attached patch (not tested)

Index: File-Listing-6.04/lib/File/Listing.pm
===================================================================
--- File-Listing-6.04.orig/lib/File/Listing.pm
+++ File-Listing-6.04/lib/File/Listing.pm
@@ -332 +332 @@ sub line {
-       my $filetime = Time::Local::timelocal(0,$M,$H,$d,$m-1,_guess_year($y)-1900);
+       my $filetime = Time::Local::timelocal(0,$M,$H,$d,$m-1,_guess_year($y));
@plicease plicease added the bug Something isn't working label Sep 30, 2020
@plicease
Copy link
Member Author

This should be addressed. Time::Local's year argument depends on the current year. This will require some tests though, which do not currently exists.

@plicease plicease added the help wanted Extra attention is needed label Sep 30, 2020
@plicease
Copy link
Member Author

plicease commented Oct 1, 2020

So playing around with apache in a docker container (see #14) seems as though apache always provides a four digit year so I am not sure why we are even ding _guess_year. There is also a new and old format and I think probably only will recognize one of those.

@plicease
Copy link
Member Author

plicease commented Oct 1, 2020

This should be fixed in 6.08_01

@plicease plicease closed this as completed Oct 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Development

No branches or pull requests

1 participant