[wp-trac] [WordPress Trac] #40825: Re-addressing validation/sanitization of IDs to allow filtering before WP_Post (and others) database query

WordPress Trac noreply at wordpress.org
Sat May 20 01:23:48 UTC 2017


#40825: Re-addressing validation/sanitization of IDs to allow filtering before
WP_Post (and others) database query
-------------------------------+------------------------------------
 Reporter:  LindsayBSC         |       Owner:
     Type:  enhancement        |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Posts, Post Types  |     Version:  4.7.5
 Severity:  normal             |  Resolution:
 Keywords:  dev-feedback       |     Focuses:  template, performance
-------------------------------+------------------------------------

Comment (by LindsayBSC):

 Wanted to drop a reference/link to this related ticket: #39053

 A point was made that filter_var() is not required in a PHP build for
 WordPress to compile therefore I added a fallback for that case that uses
 preg_match() to look for a collection of digits that is not 0 and does not
 start with 0 (since an ID will/should never meet those conditions)

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


More information about the wp-trac mailing list