Eliminate the use of extract() in wp_validate_auth_cookie().

Don't do anything fancy here, just set the 4 returned properties to variables. This function is semi-important.
	
See #22400.

Built from https://develop.svn.wordpress.org/trunk@28424


git-svn-id: http://core.svn.wordpress.org/trunk@28251 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2014-05-15 06:11:13 +00:00
parent eb2bbf9c97
commit f5bd0de275

View File

@ -608,13 +608,15 @@ function wp_validate_auth_cookie($cookie = '', $scheme = '') {
return false;
}
extract($cookie_elements, EXTR_OVERWRITE);
$expired = $expiration;
$scheme = $cookie_elements['scheme'];
$username = $cookie_elements['username'];
$hmac = $cookie_elements['hmac'];
$expired = $expiration = $cookie_elements['expiration'];
// Allow a grace period for POST and AJAX requests
if ( defined('DOING_AJAX') || 'POST' == $_SERVER['REQUEST_METHOD'] )
if ( defined('DOING_AJAX') || 'POST' == $_SERVER['REQUEST_METHOD'] ) {
$expired += HOUR_IN_SECONDS;
}
// Quick check to see if an honest cookie has expired
if ( $expired < time() ) {
@ -659,8 +661,9 @@ function wp_validate_auth_cookie($cookie = '', $scheme = '') {
return false;
}
if ( $expiration < time() ) // AJAX/POST grace period set above
if ( $expiration < time() ) {// AJAX/POST grace period set above
$GLOBALS['login_grace_period'] = 1;
}
/**
* Fires once an authentication cookie has been validated.