Skip to content

Conversation

@lylo
Copy link

@lylo lylo commented Dec 7, 2025

DOMPurify validates attribute values against a URI regex unless the attribute is marked as "URI safe". The caption attribute was in ALLOWED_ATTR but not in URI_SAFE_ATTRIBUTES, causing values like "photographer: name" to be stripped because the colon made it look like an unknown protocol scheme.

Adding caption and filename to ADD_URI_SAFE_ATTR prevents this validation, allowing any text content in these attributes.

DOMPurify validates attribute values against a URI regex unless the
attribute is marked as "URI safe". The caption attribute was in
ALLOWED_ATTR but not in URI_SAFE_ATTRIBUTES, causing values like
"photograph: test" to be stripped because the colon made it look
like an unknown protocol scheme.

Adding caption and filename to ADD_URI_SAFE_ATTR prevents this
validation, allowing any text content in these attributes.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant