[wp-trac] [WordPress Trac] #21767: Remove stripslashes from API functions
WordPress Trac
wp-trac at lists.automattic.com
Sun Sep 2 20:28:04 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 mbijon):
Replying to [comment:7 azaozz]:
> Sounds like we would need `maybe_strip_slashes()` and `is_slashed()`
similar to how `maybe_unserialize()` and `is_serialized()` work.
I'm not sure if testing for slashed data is necessary -- sometimes data
will need to be slashed & sometimes it won't. It would be up to a plugin
or site author to decide that, which puts us right back to the current
state of things where Alex calls it a bug.
I think I would rather see an extra parameter in the changed methods. With
a boolean that defaults to off we could current default actions as-is, but
allow someone handling JSON to easily toggle slash removal when needed.
This would resolve @scribu's very valid complaint, & provide a good
modification path in the even the preferred default behavior needs to be
the Alex' way instead of core's current.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/21767#comment:8>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list