[wp-trac] [WordPress Trac] #39053: Add function `wp_validate_integer`

WordPress Trac noreply at wordpress.org
Mon Apr 10 06:00:58 UTC 2017

#39053: Add function `wp_validate_integer`
 Reporter:  peterwilsoncc                           |       Owner:
     Type:  enhancement                             |      Status:  new
 Priority:  normal                                  |   Milestone:  4.8
Component:  General                                 |     Version:
 Severity:  normal                                  |  Resolution:
 Keywords:  has-patch has-unit-tests needs-refresh  |     Focuses:

Comment (by jipmoors):

 The only way to surface the type max size problem is to check for it and
 fail when it exceeds the limit.

 PHP_INT_SIZE will hold the maximum size an Integer can have for each
 system. Silently converting/normalizing and moving on will cause unwanted
 and obscure problems. Breaking and notifying about the problem makes it
 something that can be reasoned about and a resolution to be implemented.

Ticket URL: <https://core.trac.wordpress.org/ticket/39053#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list