Skip to content

Commit

Permalink
Maintain old behavior for default gravatar icons
Browse files Browse the repository at this point in the history
This is a follow up commit for 06b7b96
that ensures installations using $g_show_avatar = ON maintain the same
behavior as before. In other words, setting the config to ON is
equivalent to 'identicon'.

Fixes #14032
  • Loading branch information
dregad committed Aug 16, 2012
1 parent 06b7b96 commit 3b4ea93
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions config_defaults_inc.php
Expand Up @@ -1012,6 +1012,7 @@
* defining the default avatar to be used when none is associated with the
* user's email. Valid values:
* - OFF (default)
* - ON (equivalent to 'identicon')
* - One of Gravatar's defaults (mm, identicon, monsterid, wavatar, retro)
* @link http://en.gravatar.com/site/implement/images/
* - An URL to the default image to be used (for example,
Expand Down
4 changes: 4 additions & 0 deletions core/user_api.php
Expand Up @@ -814,6 +814,10 @@ function user_get_avatar( $p_user_id, $p_size = 80 ) {
# Avatars are not used
return false;
}
# Set default avatar for legacy configuration
if( ON === $t_default_avatar ) {
$t_default_avatar = 'identicon';
}

# Default avatar is either one of Gravatar's options, or
# assumed to be an URL to a default avatar image
Expand Down
2 changes: 2 additions & 0 deletions docbook/Admin_Guide/en-US/Configuration.xml
Expand Up @@ -959,6 +959,8 @@
<itemizedlist>
<listitem><para>OFF (default)</para>
</listitem>
<listitem><para>ON (equivalent to 'identicon')
</para></listitem>
<listitem><para>One of Gravatar's defaults
(mm, identicon, monsterid, wavatar, retro);
refer to
Expand Down

0 comments on commit 3b4ea93

Please sign in to comment.