mirror of https://github.com/sveltejs/svelte
fix: always case insensitive event handlers during ssr (#17822)
Fixes events not being stripped on svg, mathml and custom elements. ### Before submitting the PR, please make sure you do the following - [x] It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs - [x] Prefix your PR title with `feat:`, `fix:`, `chore:`, or `docs:`. - [x] This message body should clearly illustrate what problems it solves. - [x] Ideally, include a test that fails without this PR but passes with it. - [x] If this PR changes code within `packages/svelte/src`, add a changeset (`npx changeset`). ### Tests and linting - [x] Run the tests with `pnpm test` and lint the project with `pnpm lint` --------- Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>pull/17812/head
parent
e3d277b000
commit
b6faa2a905
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
'svelte': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
fix: always case insensitive event handlers during ssr
|
||||||
|
After Width: | Height: | Size: 125 B |
@ -0,0 +1,16 @@
|
|||||||
|
<script>
|
||||||
|
const userdata = {
|
||||||
|
ONCLICK: 'alert(document.cookie)',
|
||||||
|
ONMOUSEOVER: 'alert("XSS")'
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<svg {...userdata}>
|
||||||
|
<circle cx="12" cy="12" r="10" />
|
||||||
|
</svg>
|
||||||
|
|
||||||
|
<math {...userdata}>
|
||||||
|
<mi>x</mi>
|
||||||
|
</math>
|
||||||
|
|
||||||
|
<custom-element {...userdata}></custom-element>
|
||||||
Loading…
Reference in new issue