Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.x] Merge additional params after SVG sanitization #10400

Merged
merged 2 commits into from
Jul 12, 2024

Conversation

heidkaemper
Copy link
Contributor

This PR makes sure that the SVG tag adds additional parameters after sanitization. This solves the problem of parameters being unintentionally removed by the sanitizer.

Until 5.0 this was possible without any issues:

Antlers:
{{ svg src="logo" x-ref="logo" }}

Result:
<svg x-ref="logo" xmlns="...

But since 5.0 this has changed, as sanitizing is active by default:

Antlers:
{{ svg src="logo" x-ref="logo" }}

Result:
<svg xmlns="...

We can set sanitize="false" of course. But in my opinion, it would be nicer to have the best of both worlds. First sanitizing potentially dangerous code, then merge additional parameters.

This relates to #9948 and potentially to #10161 as well.

@heidkaemper heidkaemper changed the title [5.x] Merge additional params after sanitization [5.x] Merge additional params after SVG sanitization Jul 5, 2024
@jasonvarga jasonvarga merged commit 18feb0e into statamic:5.x Jul 12, 2024
16 checks passed
@heidkaemper heidkaemper deleted the svg-tag-sanitize-first branch July 13, 2024 09:00
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