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

WordPress Trac noreply at wordpress.org
Wed Nov 18 18:02:53 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        |     Focuses:
-----------------------------+------------------

Comment (by joehoyle):

 Replying to [comment:3 TimothyBlynJacobs]:
 > In most cases it would be fine, but it'd be a problem with functions
 that use a variable number of arguments.
 >
 > I'd imagine something like this. Though you're right that'd get clunky
 as well. Especially for a object function name pair.
 >
 > {{{#!php
 > $arg['validate_callback'] = array( 'myfunction', 1 );
 > }}}

 I'm not sure if you were pointing it out here - but this would conflict
 with the `array( 'MyClass', 'myMethod' )` syntax for the callbacks.

 I'm not a big fan of a whitelist, I'm +1 for specific rest validate
 functions for those tricky ones line `is_numeric()`

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


More information about the wp-trac mailing list