This project is archived and is in readonly mode.

#1662 ✓resolved
Jonathan del Strother

JSON decoder date-converter is overeager

Reported by Jonathan del Strother | December 29th, 2008 @ 02:32 AM | in 2.x

The json decoder tries to recognise dates & reformats them so that Date/Time objects will get created. I'm pretty sure the regular expression for spotting the date is missing a couple of brackets. It has 2 sub-expressions, separated by an '|', which binds less tightly than the anchor points at either end, so the first sub-expression is only anchored at the beginning, and the second sub-expression is only anchored at the end.

The attached patch adds tests & fixes the regex.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

People watching this ticket

Attachments

Tags

Referenced by

Pages