Skip to content

Commit fb0b35d

Browse files
authored
Escape user data in server-data.rst
Escape user data for HTML attributes to prevent XSS. This is already done in the second code snippet below.
1 parent b2b6f26 commit fb0b35d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

frontend/server-data.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ them later in JavaScript. For example:
1010

1111
<div class="js-user-rating"
1212
data-is-authenticated="{{ app.user ? 'true' : 'false' }}"
13-
data-user="{{ app.user|serialize(format = 'json') }}"
13+
data-user="{{ app.user|serialize(format = 'json')|e('html_attr') }}"
1414
>
1515
<!-- ... -->
1616
</div>

0 commit comments

Comments
 (0)