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
fix(security): Use format_html for avatar related functions (#58319)
Continuation of #58227
According to Django docs:
https://docs.djangoproject.com/en/4.2/ref/utils/#django.utils.html.format_html
> For the case of building up small HTML fragments, this function is to
be preferred over string interpolation using `%` or `str.format()`
directly, because it applies escaping to all arguments - just like the
template system applies escaping by default.
> So, instead of writing:
>
> ```
> mark_safe(
> "%s <b>%s</b> %s"
> % (
> some_html,
> escape(some_text),
> escape(some_other_text),
> )
> )
> ```
> You should instead use:
>
> ```
> format_html(
> "{} <b>{}</b> {}",
> mark_safe(some_html),
> some_text,
> some_other_text,
> )
> ```
0 commit comments