mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-01 15:50:09 +00:00
Use PHP7's random_int() CSPRNG functionality in wp_rand() with a fallback to the random_compat library for PHP 5.x.
`random_compat` offers a set of compatible functions for older versions of PHP, filling in the gap by using other PHP extensions when available. We still include our existing `wp_rand()` functionality as a fallback for when no proper CSPRNG exists on the system. Props sarciszewski See #28633 git-svn-id: https://develop.svn.wordpress.org/trunk@34922 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -332,3 +332,8 @@ if ( ! interface_exists( 'JsonSerializable' ) ) {
|
||||
public function jsonSerialize();
|
||||
}
|
||||
}
|
||||
|
||||
// random_int was introduced in PHP 7.0
|
||||
if ( ! function_exists( 'random_int' ) ) {
|
||||
require ABSPATH . WPINC . '/random_compat/random.php';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user