#1076 enhancement
jvoorhis

Deprecate String#isJSON

Reported by jvoorhis | June 17th, 2010 @ 10:54 PM | in 2.0

String.isJSON() accepts mismatched leading or trailing brackets and braces.

Synopsis:

"{}}".isJSON()
> true

"{{}".isJSON()
> true

This was found in version 1.6.1, but appears to not be fixed in master.

Comments and changes to this ticket

  • Tobie Langel

    Tobie Langel June 18th, 2010 @ 01:29 AM

    • Tag changed from json to section:lang

    String.prototype.isJSON is really meant for internal use only. I agree its ill-named, though, as it role is to verify the string can be securely evaluated.

    I think we should just deprecate it as a public API.

  • jvoorhis

    jvoorhis June 18th, 2010 @ 01:45 AM

    Deprecating it is good, but String.prototype.evalJSON() depends on it for implementing the 'sanitize' parameter.

  • Tobie Langel

    Tobie Langel June 18th, 2010 @ 12:54 PM

    That's what I meant by deprecating it as a public API (keep the functionality, just avoid exposing it).

  • Tobie Langel

    Tobie Langel June 18th, 2010 @ 12:56 PM

    • Milestone set to 2.0
    • State changed from “new” to “enhancement”
    • Assigned user set to “Tobie Langel”
    • Title changed from “String.isJSON() accepts invalid JSON” to “Deprecate String#isJSON”

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

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

The Prototype JavaScript library.

Shared Ticket Bins

Pages