Skip to content

Commit

Permalink
Conditionally use SHA-256 or MD5 for Gravatar hashing depending on su…
Browse files Browse the repository at this point in the history
…pport.
  • Loading branch information
johnbillion committed Jan 7, 2025
1 parent 2bab211 commit 8a50627
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/wp-includes/link-template.php
Original file line number Diff line number Diff line change
Expand Up @@ -4534,7 +4534,11 @@ function get_avatar_data( $id_or_email, $args = null ) {
}

if ( $email ) {
$email_hash = hash( 'sha256', strtolower( trim( $email ) ) );
if ( function_exists( 'hash' ) ) {
$email_hash = hash( 'sha256', strtolower( trim( $email ) ) );
} else {
$email_hash = md5( strtolower( trim( $email ) ) );
}
}
}

Expand Down

0 comments on commit 8a50627

Please sign in to comment.