Merge pull request #20210 from rnaby/240518-223657-wc-core-functions-wc_rand_hash

wc_rand_hash logic simplified
This commit is contained in:
Mike Jolley 2018-05-25 10:33:41 +01:00 committed by GitHub
commit 571919936c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -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
}
/**