[wp-trac] [WordPress Trac] #21767: Remove stripslashes from API functions
WordPress Trac
wp-trac at lists.automattic.com
Mon Sep 17 21:03:03 UTC 2012
#21767: Remove stripslashes from API functions
-------------------------------------------------+-------------------------
Reporter: alexkingorg | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting
Component: General | Review
Severity: normal | Version: trunk
Keywords: has-patch needs-testing needs-unit- | Resolution:
tests |
-------------------------------------------------+-------------------------
Comment (by nacin):
Replying to [ticket:21767 alexkingorg]:
> The data I was saving was in JSON format. I was putting it in like this:
>
> {{{
>
{"profile_image_url":"http:\/\/a0.twimg.com\/profile_images\/17084282\/alex_king_normal.jpg"}
> }}}
>
> and getting it back liks this:
>
> {{{
>
{"profile_image_url":"http://a0.twimg.com/profile_images/17084282/alex_king_normal.jpg"}
> }}}
>
> As you can imagine, `json_decode()` fails on this data.
Worth pointing out (as pointed out to me by mdawaffe) that json_decode()
doesn't fail on that data. JS object notation is pretty liberal when it
comes to this. There are certainly good examples of how slash expectations
can cause problems, but this isn't it. Needs unit tests. :-)
--
Ticket URL: <http://core.trac.wordpress.org/ticket/21767#comment:15>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list