Skip to content

Commit

Permalink
Update Gravatar query.
Browse files Browse the repository at this point in the history
* Return a 200x200 pixel avatar, rather than the 80x80 default.
* Return a 404 when no gravatar exists.
* Censor explicit gravatars.
  • Loading branch information
evansims committed Mar 31, 2013
1 parent 6047ad1 commit ed73d1f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/api.2-0.php
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@
if(HTTP_METHOD == 'GET') {

$avatar = $User->Avatar();
if(!$avatar) $avatar = 'http://www.gravatar.com/avatar/' . md5(strtolower(trim($User->Email()))) . '?s=200&d=404';
if(!$avatar) $avatar = 'http://www.gravatar.com/avatar/' . md5(strtolower(trim($User->Email()))) . '?r=PG&s=200&d=404';

Response::Send(200, RESP_OK, array(
'avatar' => $avatar
Expand Down Expand Up @@ -639,7 +639,7 @@
if(HTTP_METHOD == 'GET') {

$avatar = $User->Avatar();
if(!$avatar) $avatar = 'http://www.gravatar.com/avatar/' . md5(strtolower(trim($User->Email())));
if(!$avatar) $avatar = 'http://www.gravatar.com/avatar/' . md5(strtolower(trim($User->Email()))) . '?r=PG&s=200&d=404';

if(isSessionCleared($User->Hash())) {
// Get information about user.
Expand Down

0 comments on commit ed73d1f

Please sign in to comment.