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.


git-svn-id: https://develop.svn.wordpress.org/trunk@28424 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor 2014-05-15 06:10:21 +00:00
parent 034de7f1de
commit 3c418d4b57
1 changed files with 8 additions and 5 deletions

View File

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