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

fix(js): Fix typo in String.prototype.md5() #349

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

Conversation

tomushkin
Copy link

The minified String.prototype.md5() implementation is missing a couple of backslashes in replace(s/rn//g, "n") causing contacts that contain "rn" to not have the gravatar displayed.

Also it's doing toLowerCase() on its input, which doesn't seem correct.

This was causing some gravatars to not display properly
@WoodySlum
Copy link
Member

Hi !

Thank you for your contribution
I would prefer to do email.toLowerCase().md5().toLowerCase() instead of, modifying common.js. I didn't see any other use of md5 string prototype, but it may be the case in the future.

@tomushkin
Copy link
Author

Hello, the inner md5 function already does toLowerCase() on the hash. The public function does it on the input which must be a mistake:

  var md5 = function(s){...; return i.toLowerCase();};
  return md5(this.toLowerCase());

I moved the second call from this to email, which effectively is what you are suggesting?

@WoodySlum WoodySlum self-requested a review June 4, 2024 09:16
@WoodySlum WoodySlum self-assigned this Jun 4, 2024
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.

2 participants