Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/wp-includes/pluggable.php
Original file line number Diff line number Diff line change
Expand Up @@ -3054,10 +3054,11 @@ function wp_rand( $min = null, $max = null ) {
global $rnd_value;

/*
* Some misconfigured 32-bit environments (Entropy PHP, for example)
* truncate integers larger than PHP_INT_MAX to PHP_INT_MAX rather than overflowing them to floats.
* On 32-bit systems, 0xffffffff exceeds PHP_INT_MAX, so it is cast to a float explicitly.
* Some misconfigured 32-bit environments (Entropy PHP, for example) truncate integer literals
* larger than PHP_INT_MAX to PHP_INT_MAX rather than overflowing them to floats.
*/
$max_random_number = 3000000000 === 2147483647 ? (float) '4294967295' : 4294967295; // 4294967295 = 0xffffffff
$max_random_number = PHP_INT_SIZE === 4 ? (float) '4294967295' : 4294967295; // 4294967295 = 0xffffffff

if ( null === $min ) {
$min = 0;
Expand Down
25 changes: 0 additions & 25 deletions tests/phpstan/baselines/identical.alwaysFalse.neon

This file was deleted.

Loading