Repository navigation
Keep the query string on avatar URLs for gravatar_default - #275
Merged
Merged
Conversation
The logged-out comment form template appends `&s=` to the avatar URL. Since #274, a gravatar_default site's avatar URL has no `?`, so the size lands in the path and Gravatar serves the default 80px image. Always keep the `?`, and test the URL the template builds. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug fix
JavaScript change in
getUserFor(), plus an updated QUnit test. Follow-up to #274.The logged-out comment form template,
inc/tpl/logged-out-create-comment.php, appends&s=to the avatar URL thatgetUserFor()builds. Since #274, a site withavatar_defaultset togravatar_defaultgets an avatar URL with no?, so the size lands in the URL path:https://gravatar.com/avatar/&s=32. Gravatar returns its 80px default image, which the<img>scales down.https://gravatar.com/avatar/?&s=32. Gravatar returns the 32px image.getUserFor()now always adds the?and only leaves outd=. Other defaults are unchanged.Rationale
Code may append parameters to this URL, and with no
?the first&lands in the path. Keeping the?makes appended parameters work the same for every default.Testing this change
npx grunt qunitpasses. ThegetUserFortest now checks the URL the template builds, and it fails onmaster.npx grunt lintpasses.avatar_defaultset togravatar_default, the logged-out comment form rendershttps://gravatar.com/avatar/?&s=32. Onmasterit rendershttps://gravatar.com/avatar/&s=32.avatar_defaultset toidenticon, the form rendershttps://gravatar.com/avatar/?d=identicon&s=32.Definition of done
sin the query string forgravatar_defaultd🤖 Generated with Claude Code