wp/wp-includes/class-wp-session-tokens.php
changeset 22 8c2e4d02f4ef
parent 21 48c4eec2b7e6
equal deleted inserted replaced
21:48c4eec2b7e6 22:8c2e4d02f4ef
    66 	 *
    66 	 *
    67 	 * @param string $token Session token to hash.
    67 	 * @param string $token Session token to hash.
    68 	 * @return string A hash of the session token (a verifier).
    68 	 * @return string A hash of the session token (a verifier).
    69 	 */
    69 	 */
    70 	private function hash_token( $token ) {
    70 	private function hash_token( $token ) {
    71 		// If ext/hash is not present, use sha1() instead.
    71 		return hash( 'sha256', $token );
    72 		if ( function_exists( 'hash' ) ) {
       
    73 			return hash( 'sha256', $token );
       
    74 		} else {
       
    75 			return sha1( $token );
       
    76 		}
       
    77 	}
    72 	}
    78 
    73 
    79 	/**
    74 	/**
    80 	 * Retrieves a user's session for the given token.
    75 	 * Retrieves a user's session for the given token.
    81 	 *
    76 	 *