KamoCRM

Read a photo's real extension through a lazy proxy

Fixkamo-shared-library
Shipped
November 12, 2026 at 4:40 AM UTC
Author
Kamo
Commit
1539dba

member.getAvatar() returns a proxy of the base Avatar type, so instanceof AvatarPhoto was false and every photo was addressed as .png. A .jpg upload then 404'd, and the public officer card (loan application, member-pinned web chat) showed initials for a member who has a photo. Unproxy before reading the extension.

All changes

Like what you see shipping?

All of it arrives in your workspace on its own. Start on the free plan and read this page again in a month.

Start Free ForeverView Pricing