You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Can't pass an escaped string literal into a component method with CSP version #4879
When passing an escaped string literal into an alpine component method, it is not parsed in the CSP version of alpine, but is parsed in the regular version.
The below example demonstrates this with two buttons: one that passes test and the other that passes tes\u0027t:
Passing test works fine for both versions.
Passing tes\u0027t results in tes't in the regular version, but tesu0027t in the CSP version.
This is particularly problematic when using laravel's Js::from() such as x-data="component({{ Js::from($test) }})"function, as it escapes apostrophes and other common symbols which get misread inside the component.
Activity