Skip to content

Commit

Permalink
支持自定义gravatar url前缀
Browse files Browse the repository at this point in the history
  • Loading branch information
joyqi committed Jan 20, 2015
1 parent a867645 commit 5c0ed25
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions var/Typecho/Common.php
Original file line number Diff line number Diff line change
Expand Up @@ -936,8 +936,12 @@ public static function url($path, $prefix)
*/
public static function gravatarUrl($mail, $size, $rating, $default, $isSecure = false)
{
$url = $isSecure ? 'https://secure.gravatar.com' : 'http://www.gravatar.com';
$url .= '/avatar/';
if (defined('__TYPECHO_GRAVATAR_PREFIX__')) {
$url = __TYPECHO_GRAVATAR_PREFIX__;
} else {
$url = $isSecure ? 'https://secure.gravatar.com' : 'http://www.gravatar.com';
$url .= '/avatar/';
}

if (!empty($mail)) {
$url .= md5(strtolower(trim($mail)));
Expand Down

0 comments on commit 5c0ed25

Please sign in to comment.