PR#3450: convert data to string in escapeHTML first

Merges #3450
https://pagure.io/koji/pull-request/3450

Fixes: #3449
https://pagure.io/koji/issue/3449
Fix html escaping for non-strings
This commit is contained in:
Tomas Kopecek 2022-08-17 11:16:21 +02:00
commit 37b207cf44

View file

@ -625,7 +625,7 @@ def escapeHTML(value):
if not value:
return value
value = koji.fixEncoding(value)
value = koji.fixEncoding(str(value))
return re.sub(r'&(?![a-zA-Z0-9#]+;)', '&', value).\
replace('<', '&lt;').\
replace('>', '&gt;').\