Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

There was a problem

You must be a member of this account.

This project is archived and is in readonly mode.

JSON decoder date-converter is overeager

#1662

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.

Reported by Jonathan del Strother · December 29th, 2008 @ 02:32 AM

State: resolved
Milestone: 2.x
Assigned to: nobody
Importance: none

Activity

  1. Jonathan del Strother
    Jonathan del Strother
    • Tag set to patch
    • Title changed from [PATCH] JSON decoder date-converter is overeager to JSON decoder date-converter is overeager

    December 29th, 2008 @ 11:37 AM

  2. Repository
    Repository
    • State changed from new to resolved

    (from [17da45b789e0a2581eae6e6b2b1ae8d2b98e0f5d]) Fix JSON decoder date-converter regexp [#1662 JSON decoder date-converter is overeager state:resolved] [Jonathan del Strother] http://github.com/rails/rails/co...

    January 7th, 2009 @ 05:53 PM

  3. Repository
    Repository

    (from [b1530545d259c144770bd8fd7881cb16160c0afc]) Fix JSON decoder date-converter regexp [#1662 JSON decoder date-converter is overeager state:resolved] [Jonathan del Strother] http://github.com/rails/rails/co...

    February 2nd, 2009 @ 07:57 PM