修复包含大写字母的邮箱获取Gravatar头像错误问题

This commit is contained in:
Lanfei 2014-01-07 13:58:09 +08:00
parent bc7fd3e097
commit 47e54f201e
2 changed files with 2 additions and 2 deletions

View File

@ -12,7 +12,7 @@ $stat = Typecho_Widget::widget('Widget_Stat');
<div class="row typecho-page-main">
<div class="col-mb-12 col-tb-3">
<p><a href="http://gravatar.com/emails/" title="<?php _e('在 Gravatar 上修改头像'); ?>"><?php echo '<img class="profile-avatar" src="'
. ($request->isSecure() ? 'https://secure' : 'http://www') . '.gravatar.com/avatar/' . md5($user->mail) . '?s=220&r=X' .
. ($request->isSecure() ? 'https://secure' : 'http://www') . '.gravatar.com/avatar/' . md5(strtolower($user->mail)) . '?s=220&r=X' .
'&d=mm" alt="' . $user->screenName . '" />'; ?></a></p>
<h2><?php $user->screenName(); ?></h2>
<p><?php $user->name(); ?></p>

View File

@ -239,7 +239,7 @@ class Widget_Abstract_Users extends Widget_Abstract
public function gravatar($size = 40, $rating = 'X', $default = NULL, $class = NULL)
{
echo '<img' . (empty($class) ? '' : ' class="' . $class . '"') . ' src="http://www.gravatar.com/avatar/' .
md5($this->mail) . '?s=' . $size . '&amp;r=' . $rating . '&amp;d=' . $default . '" alt="' .
md5(strtolower($this->mail)) . '?s=' . $size . '&amp;r=' . $rating . '&amp;d=' . $default . '" alt="' .
$this->screenName . '" width="' . $size . '" height="' . $size . '" />';
}
}