[wp-trac] [WordPress Trac] #34659: Whitelist for validation functions which only accept one argument

WordPress Trac noreply at wordpress.org
Wed Nov 18 20:42:00 UTC 2015


#34659: Whitelist for validation functions which only accept one argument
--------------------------------------+------------------
 Reporter:  danielbachhuber           |       Owner:
     Type:  defect (bug)              |      Status:  new
 Priority:  normal                    |   Milestone:  4.4
Component:  REST API                  |     Version:
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+------------------
Changes (by danielbachhuber):

 * keywords:  has-patch => has-patch has-unit-tests


Comment:

 34659.2.diff supports whitelisting specific functions to only receive one
 argument when used as sanitization or validation callbacks

 On Slack, we also
 [https://wordpress.slack.com/archives/core/p1447873482000901 explored] a
 couple other options:

 * Only ever passing one argument to the validation / sanitization
 callback. But, the extra context can be helpful, as we're using in the
 plugin itself.
 * Introducing an ancillary `validate_callback_single` argument, which
 would only pass one argument to the callback. However, this doesn't seem
 very glamorous.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/34659#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list