Skip to content
This repository was archived by the owner on Jan 9, 2023. It is now read-only.

Commit 4352eda

Browse files
meteryamgoosemania
authored andcommitted
Escape django template syntax in xml when rendering filelist
closes #496 added bugfix file (cherry picked from commit d403fab)
1 parent 6e4d140 commit 4352eda

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGES/496.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Escape django template syntax in xml when rendering filelist

pulp_2to3_migration/app/plugin/rpm/xml_utils.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919

2020
ESCAPE_TEMPLATE_VARS_TAGS = {
2121
'primary': ('description', 'summary'),
22-
'other': ('changelog',)
22+
'other': ('changelog',),
23+
'filelists': ('file',)
2324
}
2425
METADATA_TYPES = ('primary', 'other', 'filelists')
2526

@@ -141,6 +142,8 @@ def render_filelists(template, checksum):
141142
str: a rendered filelists.xml snippet
142143
143144
"""
145+
for tag in ESCAPE_TEMPLATE_VARS_TAGS['filelists']:
146+
template = _escape_django_syntax_chars(template, tag)
144147
context = Context({'pkgid': checksum})
145148
return Template(template).render(context)
146149

0 commit comments

Comments
 (0)