mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-10 21:00:59 +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 3.7 branch. Fixes #42431 and #42401 for 3.7. Built from https://develop.svn.wordpress.org/branches/3.7@42241 git-svn-id: http://core.svn.wordpress.org/branches/3.7@42070 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
009b1b4257
commit
94278eddb6
@ -1394,7 +1394,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…
Reference in New Issue
Block a user