mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
Add safeguards for when ext/hash is not compiled with PHP.
see #29518, for trunk. git-svn-id: https://develop.svn.wordpress.org/trunk@29751 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -61,7 +61,12 @@ abstract class WP_Session_Tokens {
|
||||
* @return string A hash of the session token (a verifier).
|
||||
*/
|
||||
final private function hash_token( $token ) {
|
||||
return hash( 'sha256', $token );
|
||||
// If ext/hash is not present, use sha1() instead.
|
||||
if ( function_exists( 'hash' ) ) {
|
||||
return hash( 'sha256', $token );
|
||||
} else {
|
||||
return sha1( $token );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user