This project is archived and is in readonly mode.

#2836 ✓invalid
Erik Andrejko

ActiveSupport JSON decode fails on "\\" at end of string

Reported by Erik Andrejko | June 25th, 2009 @ 03:42 PM | in 2.x

The following JSON string is not corrected decoded by ActiveSupport::JSON.decode:

{"a","1\"}

This string is correctly parsed by the json gem. A patch with a failing test is included.

Comments and changes to this ticket

  • Yehuda Katz (wycats)

    Yehuda Katz (wycats) July 2nd, 2009 @ 07:38 PM

    • State changed from “new” to “invalid”

    This is an invalid JSON object. JSON key/value pairs are required to be enclosed in {}, and JSON Arrays are required to be enclosed in [].

  • Erik Andrejko

    Erik Andrejko July 3rd, 2009 @ 01:06 AM

    That was a typo. The JSON string, as is in the test, should be:

    {"a" : "1"}

    I believe that the ActiveSupport JSON parser will fail for any value which ends in "".

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>

Attachments

Tags

Pages