WeblateOrg / weblate

Insecure use of format_html detected PY-S0901
Security
Major
3 months agoa year old
Insecure use of 'format_html()' function
 915
 916    def get_plural_label(self, idx):
 917        """Return label for plural form."""
 918        return format_html( 919            PLURAL_TITLE,
 920            name=self.get_plural_name(idx),
 921            examples=", ".join(self.examples.get(idx, [])),
Insecure use of 'format_html()' function
103    if only:
104        return params[only]
105
106    return format_html(SOCIAL_TEMPLATE, separator=separator, **params)107
108
109def get_auth_name(auth: str):
Insecure use of 'format_html()' function
 98
 99    if not params["image"].startswith("http"):
100        params["image"] = staticfiles_storage.url("auth/" + params["image"])
101    params["icon"] = format_html(IMAGE_SOCIAL_TEMPLATE, separator=separator, **params)102
103    if only:
104        return params[only]
Insecure use of 'format_html()' function
148    for language in data:
149        name, translators = language.popitem()
150        language_outputs.append(
151            format_html_or_plain(152                language_format,
153                language=name,
154                translators=format_html_or_plain_join(
Insecure use of 'format_html()' function
 46        for key, value in kwargs.items()
 47    }
 48    if safe_kwargs:
 49        return format_html(escape(format_string), **safe_kwargs) 50    return mark_safe(escape(format_string))  # noqa: S308
 51
 52