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

HTTP::Date::parse_date accepts iso-date with malformed TZ: "1996-02-29 12:00:00 -01::00" [rt.cpan.org #101378] #7

Open
oalders opened this issue Nov 5, 2019 · 0 comments
Assignees

Comments

@oalders
Copy link
Member

oalders commented Nov 5, 2019

Migrated from rt.cpan.org#101378 (status was 'new')

Requestors:

Attachments:

From torge.husfeldt@1und1.de on 2015-01-07 16:16:44
:

Hi,

to reproduce:

>perl -w -Mstrict -MHTTP::Date -e 'my ($yr, $mon, $day, $hr, $min, $sec,
$tz) = HTTP::Date::parse_date("1996-02-29 12:00:00 -01::00"); printf
"%s\n", $tz;'
-01::00

I guess the optional colon was indeed intended as a non-capturing,
grouping paranthesis in this regexp:

grep -C5 -nF '(:?' Date.pm.orig
158-	       (?:\s+|[-:Tt])  # separator before clock
159-	    (\d\d?):?(\d\d)    # hour:min
160-	    (?::?(\d\d(?:\.\d*)?))?  # optional seconds (and fractional)
161-	 )?                    # optional clock
162-	    \s*
163:	 ([-+]?\d\d?:?(:?\d\d)?
164-	  |Z|z)?               # timezone  (Z is "zero meridian", i.e. GMT)
165-	    \s*$
166-	/x)
167-

Proposed patch attached.



-- 
Torge Husfeldt

Senior Anti-Abuse Engineer
Abuse-Department 1&1 International

1&1 Internet Service GmbH | Brauerstra�e 50 | 76135 Karlsruhe | Germany
Phone: +49 721 91374-4795
E-Mail: torge.husfeldt@1und1.de | Web: www.1und1.de

Hauptsitz Montabaur, Amtsgericht Montabaur, HRB 20141

Geschäftsführer: Frank Einhellinger, Uwe Lamnek, Jan Oetjen


Member of United Internet

Diese E-Mail kann vertrauliche und/oder gesetzlich geschützte
Informationen enthalten. Wenn Sie nicht der bestimmungsgemä�e Adressat
sind oder diese E-Mail irrtümlich erhalten haben, unterrichten Sie bitte
den Absender und vernichten Sie diese E-Mail. Anderen als dem
bestimmungsgemä�en Adressaten ist untersagt, diese E-Mail zu speichern,
weiterzuleiten oder ihren Inhalt auf welche Weise auch immer zu verwenden.

This e-mail may contain confidential and/or privileged information. If
you are not the intended recipient of this e-mail, you are hereby
notified that saving, distribution or use of the content of this e-mail
in any way is prohibited. If you have received this e-mail in error,
please notify the sender and delete the e-mail.


@simbabque simbabque self-assigned this Sep 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants