Skip to content

Commit b088201

Browse files
committed
Escape alt text in templatetag before marking safe.
Thanks to Santos Gallegos at Read the Docs for reporting this issue.
1 parent 24d5978 commit b088201

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

django_gravatar/templatetags/gravatar.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def gravatar(user_or_email, size=GRAVATAR_DEFAULT_SIZE, alt_text='', css_class='
3636
return mark_safe(
3737
'<img class="{css_class}" src="{src}" width="{width}"'
3838
' height="{height}" alt="{alt}" />'.format(
39-
css_class=css_class, src=url, width=size, height=size, alt=alt_text
39+
css_class=css_class, src=url, width=size, height=size, alt=escape(alt_text)
4040
)
4141
)
4242

0 commit comments

Comments
 (0)