Skip to content

Commit 7c52e1c

Browse files
committed
Escape quotes in jinja variables rendered to JS strings
1 parent 8a82ad4 commit 7c52e1c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/templates/users/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616

1717
{% block resource_actions %}
1818
<a href="#" class="btn btn-primary" onclick="
19-
if (confirm('{{ i18n('interface.users.confirm_sendmail', [resource.email]) }}')) {
20-
location.href = '{{ url_for('sendmail_%s' % endpoint_suffix, id=resource[pkey]) }}';
19+
if (confirm('{{ i18n('interface.users.confirm_sendmail', [resource.email]).replace("'", "\\'") }}')) {
20+
location.href = '{{ url_for('sendmail_%s' % endpoint_suffix, id=resource[pkey]).replace("'", "\\'") }}';
2121
}
2222
" role="button">
2323
{{ utils.render_icon('envelope') }} {{ i18n('interface.users.sendmail') }}

0 commit comments

Comments
 (0)