mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-03-31 02:34:38 +00:00
Don't fallback to DB info for secret key. Allow expiration grace period for AJAX requests. see #5367
git-svn-id: https://develop.svn.wordpress.org/trunk@6471 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -336,8 +336,8 @@ function wp_validate_auth_cookie($cookie = '') {
|
||||
|
||||
$expired = $expiration;
|
||||
|
||||
// Allow a grace period for POST requests
|
||||
if ( 'POST' == $_SERVER['REQUEST_METHOD'] )
|
||||
// Allow a grace period for POST and AJAX requests
|
||||
if ( defined('DOING_AJAX') || 'POST' == $_SERVER['REQUEST_METHOD'] )
|
||||
$expired += 3600;
|
||||
|
||||
if ( $expired < time() )
|
||||
@@ -699,18 +699,17 @@ endif;
|
||||
|
||||
if ( !function_exists('wp_salt') ) :
|
||||
function wp_salt() {
|
||||
|
||||
if ( defined('SECRET_KEY') && '' != SECRET_KEY )
|
||||
return SECRET_KEY;
|
||||
|
||||
$salt = get_option('secret');
|
||||
if ( empty($salt) ) {
|
||||
$salt = wp_generate_password();
|
||||
update_option('secret', $salt);
|
||||
}
|
||||
|
||||
if ( !defined('SECRET_KEY') || '' == SECRET_KEY )
|
||||
$secret_key = DB_PASSWORD . DB_USER . DB_NAME . DB_HOST . ABSPATH;
|
||||
else
|
||||
$secret_key = SECRET_KEY;
|
||||
|
||||
return $salt . $secret_key;
|
||||
return $salt;
|
||||
}
|
||||
endif;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user