Skip to content

avatar_default.png broken on some pages #28945

Closed
@JanRomero

Description

@JanRomero

Description

New users who have not uploaded a custom avatar are shown with a broken image in our installation. The HTML generated for the big image on the user profile looks like this, which is clearly wrong:

/avatars/%2Fassets%2Fimg%2Favatar_default.png?size=512
As you can see, the path contains escaped forward slashes and is wrongly prefixed with “/avatars”.

In the install directory the image is set up under /custom/public/assets/img/avatar_default.png. I’m pretty sure that’s correct, because it is shown nicely on anonymous commits, where the generated HTML looks as expected.

Our config in app.ini looks like this. This is the entire section and it’s reflected in the admin panel. We don’t have any other avatar settings in the UI or in app.ini that I’m aware of.

[picture]
DISABLE_GRAVATAR = true
ENABLE_FEDERATED_AVATAR = false

If this is indeed a bug, I imagine it lives here, but I’m only browsing the source on github and don’t know what I’m doing:

u.Path = path.Join(u.Path, "/assets/img/avatar_default.png")

Thank you very much! Sorry if this is a misconfiguration on my end.

Screenshots

Gitea Version

1.21.4

Can you reproduce the bug on the Gitea demo site?

No

Operating System

Windows

Browser Version

Any

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions