mirror of https://github.com/sveltejs/svelte
fix: sanitize template-literal-special-characters in SSR attribute values (#17692)
Fixes a minor bug where HTML entities could be decoded into significant characters in the template literal we output for SSR, leading to weird effects. Not a security issue because it has to be literally written into the svelte file you're compiling, but still wrong. --------- Co-authored-by: Rich Harris <rich.harris@vercel.com>pull/17698/head
parent
c1c664df93
commit
75e1992141
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"svelte": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
fix: sanitize template-literal-special-characters in SSR attribute values
|
||||||
@ -0,0 +1,3 @@
|
|||||||
|
<div title="${inject} world"></div>
|
||||||
|
<div title="`backtick world"></div>
|
||||||
|
<div title="back\slash world"></div>
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
<script>
|
||||||
|
export let value = 'world';
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div title="${inject} {value}"></div>
|
||||||
|
<div title="`backtick {value}"></div>
|
||||||
|
<div title="back\slash {value}"></div>
|
||||||
Loading…
Reference in new issue