Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix an issue with avatars not loading in suggestions #21169

Merged
merged 1 commit into from
Jul 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion WordPress/Classes/Utility/WPAvatarSource.m
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ - (WPAvatarSourceType)parseURL:(NSURL *)url forAvatarHash:(NSString **)avatarHas
if ([components count] > 2) {
NSString *type = components[1];
NSString *hash = components[2];
if ([hash length] == 32) {
if ([hash length] == 32 || [hash length] == 64) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes sense given the hash is now 64 characters 👍
nitpick: I don't know why this has to verify the hash's length, since it seems unlikely we'll get the wrong length and if we do, I don't think there's harm in it. What will happen AFAIK is that we'll just request the avatar/blavatar and it'll fail.

// Looks like a valid hash
if ([type isEqualToString:@"avatar"]) {
if (avatarHash) *avatarHash = hash;
Expand Down