[wp-trac] [WordPress Trac] #26759: New Generic Sanitize Functions for Core
WordPress Trac
noreply at wordpress.org
Fri Jan 24 08:44:24 UTC 2014
#26759: New Generic Sanitize Functions for Core
-----------------------------+------------------------------
Reporter: georgestephanis | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Formatting | Version: trunk
Severity: normal | Resolution:
Keywords: dev-feedback | Focuses:
-----------------------------+------------------------------
Changes (by nacin):
* component: Validation => Formatting
Comment:
I'm not sure how useful this is, to be honest. wp_sanitize() would just be
a wrapper for preg_replace(). All that would do is obscure what's actually
occurring. Rather than hide that this is the functionality being
performed, one should just use preg_replace().
Beyond that, I like it when core can provide good utility functions. But
I've generally seen this to be a rabbit hole. You add one function like
alphanumeric, then someone wants one that only allows lowercase letters.
Or you add one function like letters, and someone wants to know why a
ligature or diatric is getting stripped. Every field is different. Maybe
work on metadata APIs will reveal some new sanitization shorthands, but I
don't think we need to be adding the kitchen sink when core doesn't have
much of a clear use for them and when it might just be more confusing than
just sanitizing things on your own.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/26759#comment:8>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list