Skip to content

Conversation

vcanales
Copy link
Member

@vcanales vcanales commented May 16, 2023

Special characters were causing patterns to crash the site due to syntax errors. In this change, we make sure that these characters are escaped before being printed to the pattern.

Tested using the string "ABC/'"-.`';//\''``" as alt text for a template image.

Fixes: #349

@vcanales vcanales added the bug Something isn't working label May 16, 2023
@vcanales vcanales requested a review from madhusudhand May 16, 2023 16:30
Copy link
Member

@mikachan mikachan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested this using TT3. I inserted an image on the home template using, "ABC/'"-.`';//''``", as the alt text. The theme was exported and activated successfully with no error messages, and I can see the image with the correct alt text.

LGTM 👍

@vcanales vcanales merged commit 0d79480 into trunk May 18, 2023
@vcanales vcanales deleted the fix/escape-template-text branch May 23, 2024 07:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Apostrophe in alt text crashes site with critical error
2 participants