Merge pull request #20210 from rnaby/240518-223657-wc-core-functions-wc_rand_hash
wc_rand_hash logic simplified
This commit is contained in:
commit
571919936c
|
@ -1136,11 +1136,11 @@ endif;
|
|||
* @return string
|
||||
*/
|
||||
function wc_rand_hash() {
|
||||
if ( function_exists( 'openssl_random_pseudo_bytes' ) ) {
|
||||
return bin2hex( openssl_random_pseudo_bytes( 20 ) ); // @codingStandardsIgnoreLine
|
||||
} else {
|
||||
if ( ! function_exists( 'openssl_random_pseudo_bytes' ) ) {
|
||||
return sha1( wp_rand() );
|
||||
}
|
||||
|
||||
return bin2hex( openssl_random_pseudo_bytes( 20 ) ); // @codingStandardsIgnoreLine
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue