[wp-trac] [WordPress Trac] #55194: wp_rand( 0, 0) result in random integer

WordPress Trac noreply at wordpress.org
Fri Feb 18 09:58:16 UTC 2022


#55194: wp_rand( 0, 0)  result in random integer
--------------------------+------------------------------
 Reporter:  mlajo         |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  General       |     Version:  5.9
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------

Comment (by azouamauriac):

 Hello welcome to WordPress trac! thanks for your report, you're right, I'm
 able to reproduce the issue, the function was introduce here [8728]. For
 what I understand it used to replace
 {{{
 mt_rand
 }}} but "why" i don't know.

 pinging @ryan as he was author of commit, may be he can enlighten us.
 And @SergeyBiryukov for milestone. I think the ticket should be milestone
 for 6.0 if it's accepted.

 Also the function always returns abs value(e.g wp_rand( -1, -1) = 1
 instead of -1)

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


More information about the wp-trac mailing list