Skip to content

Commit ae3d698

Browse files
committed
unittest report: escape html in the errors
1 parent f98adda commit ae3d698

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

graalpython/com.oracle.graal.python.test/src/python_unittests.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -774,8 +774,8 @@ def format_val(row, k):
774774
var data = tr.data('errors');
775775
if (data) {{
776776
function formatEntry(entry) {{
777-
var description = entry[0][0];
778-
var text = ('' + entry[0][1]).replace(/(.{{195}} )/g, '$1<br/>&nbsp;&nbsp;&nbsp;&nbsp;'); // break long lines
777+
var description = ('' + entry[0][0]).replace(/&/g, "&amp;").replace(/</g, "&lt;");
778+
var text = ('' + entry[0][1]).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/(.{{195}} )/g, '$1<br/>&nbsp;&nbsp;&nbsp;&nbsp;'); // break long lines
779779
var count = (entry[1] > 1 ? ('<font color="red"> (x ' + entry[1] + ')</font>') : '');
780780
return description + ': ' + text + count + '<br/>';
781781
}}

0 commit comments

Comments
 (0)