Skip to content

Encode HTML tags in component initial data - #7

Merged
jissereitsma merged 1 commit into
LokiExtensions:mainfrom
rtgschepers:encode-initial-data-html-tags
Sep 29, 2026
Merged

jissereitsma merged 1 commit into
LokiExtensions:mainfrom
rtgschepers:encode-initial-data-html-tags

Conversation

@rtgschepers

@rtgschepers rtgschepers commented Sep 29, 2026 •

Copy link
Copy Markdown

I ran into this issue while working on a checkout that also had Amasty Store Pickup as a delivery method.

Problem: Component data is written as raw JSON inside , so any HTML in it is parsed into real DOM elements. This can cause the component's blockId to stay empty, and its updates fail with "Block name not specified".

Fix: Add JSON_HEX_TAG to the json_encode() in AddHtmlAttributesToComponentBlock::getJsData() so < and > are encoded and no elements are created.

@jissereitsma

Copy link
Copy Markdown
Contributor

Thanks @rtgschepers - nice catch. I've added tests as well to check for this in the future.

@jissereitsma
jissereitsma merged commit 957bdfb into LokiExtensions:main Sep 29, 2026
jissereitsma added a commit that referenced this pull request Sep 29, 2026
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.

2 participants