Project

General

Profile

Actions

Bug #13661

closed

DateTime.parse parses strings with a month abbreviation after a word boundary as a valid date

Added by jbcden (Jacob Chae) almost 7 years ago. Updated almost 5 years ago.

Status:
Rejected
Assignee:
-
Target version:
-
[ruby-core:81683]

Description

When parsing a string like "" it parses it into a DateTime i.e.:

require 'date'
DateTime.parse('mark@gmail.com')
#=> #<DateTime: 2017-03-01T00:00:00+00:00 ((2457814j,0s,0n),+0s,2299161j)>

It seems like https://github.com/ruby/ruby/blob/9c9c46e5a30fb47068337932eefde759b2763551/ext/date/date_parse.c#L1612 is the source of the issue. I think this might just require a slight tweak of the regex, it looks like things like "" work but not "".

Actions

Also available in: Atom PDF

Like0
Like0