Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate gravatar hash by replacing md5 with sha256 #1732

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

yumusb
Copy link

@yumusb yumusb commented Feb 17, 2024

Generate gravatar hash by replacing md5 with sha256

Generate gravatar hash by replacing md5 with sha256
@@ -852,7 +852,8 @@ public static function gravatarUrl(
}

if (!empty($mail)) {
$url .= md5(strtolower(trim($mail)));
// https://docs.gravatar.com/general/hash/ Replacing md5 with sha256
$url .= hash('sha256', strtolower(trim($mail)));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

如果定义了__TYPECHO_GRAVATAR_PREFIX__,且不支持sha256的话可能就出问题了 🤔

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我觉得是否可以提供一个参数选择 hash method

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

加参数的话,调用的地方也得加一下。感觉还是用常量定义的好些

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants