mirror of
git://develop.git.wordpress.org/
synced 2025-01-29 18:48:18 +01:00
WPDB: Check that AUTH_SALT
is not empty, Fix a PHP notice when AUTH_SALT
is undefined.
Props jsonfry, mkomar, pento. Merges [42119] and [42120] to the 4.7 branch. Fixes #42431 and #42401 for 4.7. git-svn-id: https://develop.svn.wordpress.org/branches/4.7@42231 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
4e26af05f6
commit
eeb633b797
@ -1964,7 +1964,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 : rand();
|
||||
$salt = defined( 'AUTH_SALT' ) && AUTH_SALT ? AUTH_SALT : (string) rand();
|
||||
|
||||
$placeholder = '{' . hash_hmac( $algo, uniqid( $salt, true ), $salt ) . '}';
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user