web: use HTTPS for gravatar avatars

This commit is contained in:
David Anderson 2015-12-29 12:19:19 -08:00
parent ceb0c58428
commit d32e42397c
1 changed files with 7 additions and 1 deletions

View File

@ -488,6 +488,12 @@ function is_ignoring($user, $other_user) {
return in_array($other_user->id, $list);
}
// if avatar is from gravatar, make it HTTPS
//
function avatar_url($url) {
return str_replace('http:', 'https:', $url);
}
// Display an individual post
//
function show_post(
@ -579,7 +585,7 @@ function show_post(
echo "<span class=\"authorinfo\">";
if (!$filter || !$ignore_poster){
if ($user->prefs && $user->prefs->avatar!="" && (!$logged_in_user || ($logged_in_user->prefs->hide_avatars==false))) {
echo "<img class=authorinfo width=\"".AVATAR_WIDTH."\" height=\"".AVATAR_HEIGHT."\" src=\"".$user->prefs->avatar."\" alt=\"Avatar\"><br>";
echo "<img class=authorinfo width=\"".AVATAR_WIDTH."\" height=\"".AVATAR_HEIGHT."\" src=\"".avatar_url($user->prefs->avatar)."\" alt=\"Avatar\"><br>";
}
}