Fix image-block placeholder (src="" override) + published Gallery/SVG regression (safeImageUrl) #5
Reference in New Issue
Block a user
Delete Branch "placeholder-and-gallery-fix"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Two confirmed bugs (Fable diagnosed the placeholder live in-editor):
BlocksPanelcreated the Image block with an explicitsrc="", overriding the default-paramPLACEHOLDER_SRC(defaults only apply onundefined) →<img src="">broken icon. Long-standing. Fix: render guardsrc={src||PLACEHOLDER_SRC}+ drop thesrc=""+ ImageStylePanel falls back on clear.data:image/svg+xmlinsafeUrl, which broke Galleries whose default images are SVG data URIs. Root fix:data:image/svg+xmlis safe in<img>/CSS-url()(no script exec) but not as href/iframe targets. AddedsafeImageUrl(allowsdata:image/*) for image sinks (Gallery, ImageBlock, Logo/Navbar logo, FeaturesGrid, ContentSlider bg, cssValue url()); keptsafeUrl(blocksdata:svg) for href/iframe/action. Tightened the allowlist to requiredata:image/.554 tests (from 549); adversarially reviewed (no bypass, no nav sink weakened).
🤖 Generated with Claude Code