diff --git a/src/wp-includes/wp-db.php b/src/wp-includes/wp-db.php index 04792d4db4..19f79c42b0 100644 --- a/src/wp-includes/wp-db.php +++ b/src/wp-includes/wp-db.php @@ -1946,7 +1946,7 @@ class wpdb { // If ext/hash is not present, compat.php's hash_hmac() does not support sha256. $algo = function_exists( 'hash' ) ? 'sha256' : 'sha1'; // Old WP installs may not have AUTH_SALT defined. - $salt = defined( 'AUTH_SALT' ) ? AUTH_SALT : (string) rand(); + $salt = defined( 'AUTH_SALT' ) && AUTH_SALT ? AUTH_SALT : (string) rand(); $placeholder = '{' . hash_hmac( $algo, uniqid( $salt, true ), $salt ) . '}'; }