[FIX]report_py3o: Escape correctly html characters.

This commit is contained in:
jesusVMayor
2017-12-19 16:40:16 +01:00
committed by Elmeri Niemelä
parent f0e3256812
commit a89aa2a2f9
2 changed files with 15 additions and 3 deletions

View File

@@ -7,6 +7,7 @@ from base64 import b64decode
from cStringIO import StringIO
import logging
import os
import cgi
from contextlib import closing
import subprocess
@@ -64,8 +65,7 @@ def py3o_report_extender(report_xml_id=None):
def format_multiline_value(value):
if value:
return Markup(value.replace('<', '&lt;').replace('>', '&gt;').
replace('\n', '<text:line-break/>').
return Markup(cgi.escape(value).replace('\n', '<text:line-break/>').
replace('\t', '<text:s/><text:s/><text:s/><text:s/>'))
return ""