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

WordPress Trac noreply at wordpress.org
Thu Oct 1 02:40:03 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):

 After asking for more reviews of the code here, the only issue that's been
 raised, is the following use-case:
 {{{
 $val = wp_rand(); // (int) 0
 }}}

 This is because `$min` and `$max` are `0` by default, so.. it makes sense,
 but `wp_rand()` decides that this should instead be interpreted as a
 maximum of `4294967295`. I think we can/should just use `4294967295` when
 `$max = 0`

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


More information about the wp-trac mailing list