Skip to content

Commit 5b2faf5

Browse files
authored
Merge pull request #3028 from SUSE/autoescape_template
Avoid unsafe variable expansion without escaping
2 parents af8341e + b92d259 commit 5b2faf5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/staging/project_setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@
1717

1818
USERS_FOR_STAGING = ["avicenzi"]
1919

20-
META_TEMPLATE = jinja2.Template("""<project name="{{ project_name }}">
20+
META_TEMPLATE = jinja2.Environment(autoescape=True).from_string("""<project name="{{ project_name }}">
2121
<title>{{ project_title }}</title>
2222
{% if project_description %} <description>{{ project_description }}</description>{% else %} <description/>{% endif %}
2323
{% for user in maintainers %} <person userid="{{ user }}" role="maintainer"/>
2424
{% endfor %}{% if extra_header %}
25-
{{ extra_header }}{% endif %}
25+
{{ extra_header | safe }}{% endif %}
2626
<build>
2727
<enable/>
2828
</build>

0 commit comments

Comments
 (0)