[wp-trac] [WordPress Trac] #28633: Generate better random numbers

WordPress Trac noreply at wordpress.org
Wed Sep 23 04:17:59 UTC 2015


#28633: Generate better random numbers
-------------------------------------------+------------------------
 Reporter:  sarciszewski                   |       Owner:  dd32
     Type:  enhancement                    |      Status:  reviewing
 Priority:  normal                         |   Milestone:  4.4
Component:  Security                       |     Version:
 Severity:  normal                         |  Resolution:
 Keywords:  needs-testing has-patch early  |     Focuses:
-------------------------------------------+------------------------

Comment (by dd32):

 > Should it return abs( $val ); or absint( $val );?

 Since `random_int()` should be returning an int already, they're mostly
 the same, however for consistency you're right, we should use `absval()`.

 > Your patch for random_compat makes sense. I can't believe I overlooked
 that. As soon as you're ready, I'll merge it and tag version 1.0.2, which
 is what I'd propose to be included in WP 4.4.

 Thanks for the super-fast merge!  I couldn't find any other edge-cases in
 my testing, so a pretty good job :) The PHP7-style exception handlers seem
 solid too.

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


More information about the wp-trac mailing list