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

secure gravatar image #23

Merged
merged 1 commit into from May 7, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 9 additions & 2 deletions js/co-authors-plus.js
Expand Up @@ -283,8 +283,15 @@ jQuery(document).ready(function () {

// Adapted from http://www.deluxeblogtips.com/2010/04/get-gravatar-using-only-javascript.html
function get_gravatar_link(email, size) {
var size = size || 80;
return 'http://www.gravatar.com/avatar/' + MD5(email) + '.jpg?s=' + size;
var size = size || 80;

// need to check if page is secure or not
var gravatar_url = 'http://www.gravatar.com/avatar/';
if ("https:" == document.location.protocol) {
// secure
gravatar_url = 'https://secure.gravatar.com/avatar/';
}
return gravatar_url + MD5(email) + '.jpg?s=' + size;
}

/*
Expand Down