Make WordPress Core

#58970 closed defect (bug) (reported-upstream)

Cannot access default URL obtained by `get_avatar_url()`

Reported by: wildworks's profile wildworks Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: General Keywords:
Focuses: Cc:

Description

I searched for the cause from the issue reported on Gutenberg: https://github.com/WordPress/gutenberg/issues/53279

The get_avatar_url function always returns the following URL when force_default is enabled.

  • http://0.gravatar.com/avatar/?s=96&d=mm&f=y&r=g
  • http://secure.gravatar.com/avatar/?s=96&d=mm&f=y&r=g

However, I don't know when, but this URL seems to return a 404.

Change History (3)

#1 @wildworks
12 months ago

You can get the default image correctly by including the dummy hash value in the URL as shown below.

https://0.gravatar.com/avatar/0000000000000000000000000000000?s=96&d=mm&f=y&r=g

Gutenberg uses the avatarURL generated at:

https://github.com/WordPress/wordpress-develop/blob/b92491b8d22ba88c70b1b98805ba486502a0da05/src/wp-includes/block-editor.php#L625-L632

The hash value of the first argument should have been empty before, but I am wondering why it suddenly started returning 404.

This ticket was mentioned in Slack in #meta by timothybjacobs. View the logs.


12 months ago

#3 @kraftbj
12 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to reported-upstream
  • Status changed from new to closed

I relayed this to the Gravatar team. It does appear to be a valid bug, but I believe this is potentially a regression from a recent Gravatar change (internal repo PR 105387).

For the time being, I'm going to mark this as reported-upstream and close since it isn't a bug in Core from my understanding. It can always be reopened if the Gravatar team discovers my initial investigation is incorrect and it is a Core bug.

Note: See TracTickets for help on using tickets.