Support empty hashes in rewrite rules (or forcedefault option)

Bug #811603 reported by François Marier
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Libravatar (obsolete)
Confirmed
Low
Unassigned

Bug Description

In order to avoid having to hardcode an "unknown" email address into client code, it would be good if the following were to always return the default image:

  http://cdn.libravatar.org/avatar/

(which it currently does) but also parse the size and default parameters so that we can use this URL to output a 128x128 image for example:

  http://cdn.libravatar.org/avatar/?s=128

or this one to output a 128x128 "mystery man"

  http://cdn.libravatar.org/avatar/?s=128&d=mm

Gravatar does support this:

  http://www.gravatar.com/avatar/?s=128&d=mm
  http://www.gravatar.com/avatar/?s=128&d=mm

Note that it does NOT need to redirect to Gravatar since the image will not be there either.

Fixing this will make changes like these unnecessary:

  https://github.com/fmarier/libravatar-wordpress/commit/283be47fd654f6b5edd27b056d66d3cb0a7010fe

Tags: rewrite
Revision history for this message
François Marier (fmarier) wrote :

We should also support the "force default" (f=y) option:

  http://en.gravatar.com/site/implement/images/#force-default

Changed in libravatar:
importance: Medium → Low
summary: - Support empty hashes in rewrite rules
+ Support empty hashes in rewrite rules (or forcedefault option)
Revision history for this message
James Dearing (dearingj) wrote :

There are two uses I can think of for this:

1) To demo different settings. I'm currently writing a WordPress plugin to make it use Libravatar (I know there's one out there already, but I decided to write my own) and Libravatar not supporting the forcedefault option makes it look like my plugin doesn't work right, because the settings page shows all the same avatars.

2) Hypothetically, some site administrators might decide they like the generated avatars, and so don't want to allow non-generated ones. If they switch to Libravatar, any page that displays user avatars would be messed up because Libravatar provides the "wrong" pictures.

So yeah, it's not exactly the most important feature, but it is expected functionality if people are going to replace Gravatar.

On a side note, if forcedefault does get implemented: WordPress currently uses "forcedefault=1" rather than "forcedefault=y". So consider allowing both 1 and y.

Changed in libravatar:
assignee: nobody → François Marier (fmarier)
Changed in libravatar:
assignee: François Marier (fmarier) → nobody
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.