diff --git a/core/libs/error.py b/core/libs/error.py
index 02dbef2f..00c87813 100644
--- a/core/libs/error.py
+++ b/core/libs/error.py
@@ -6,6 +6,7 @@
import json
import logging
import numpy as np
+from html import escape
from django.core.cache import cache
@@ -123,9 +124,13 @@ def errorInfo(job, nchars=300, mode='html', **kwargs):
for error_cat in const.JOB_ERROR_CATEGORIES:
if error_cat['error'] in job and job[error_cat['error']] != '' and not job[error_cat['error']] is None and int(job[error_cat['error']]) != 0 and int(job[error_cat['error']]) not in codesDescribed:
if error_cat['diag'] is not None:
- errtxt += '{} {}: {}
'.format(error_cat['title'], job[error_cat['error']], job[error_cat['diag']])
+ errtxt += '{} {}: {}
'.format(
+ error_cat['title'],
+ job[error_cat['error']],
+ escape(job[error_cat['diag']], quote=True)
+ )
if err1 == '':
- err1 = "{}: {}".format(error_cat['name'], job[error_cat['diag']])
+ err1 = "{}: {}".format(error_cat['name'], escape(job[error_cat['diag']], quote=True))
else:
errtxt += '{} {}
'.format(error_cat['title'], job[error_cat['error']])
if err1 == '':
diff --git a/core/templates/jobInfo.html b/core/templates/jobInfo.html
index c326d550..ae13c22f 100644
--- a/core/templates/jobInfo.html
+++ b/core/templates/jobInfo.html
@@ -116,7 +116,7 @@
Job error summary: |
- Error description: {{ job.errorinfo|force_escape|safe }} |
+ Error description: {{ job.errorinfo|safe }} |
{% if job.jobdispatchererrorcode or job.brokerageerrorcode or job.ddmerrorcode or job.exeerrorcode or job.piloterrorcode or job.superrorcode or job.taskbuffererrorcode %}
Component | Code | Message |
{% if job.jobdispatchererrorcode %}
diff --git a/core/templates/jobInfoES.html b/core/templates/jobInfoES.html
index e2201fa5..331d6b7c 100644
--- a/core/templates/jobInfoES.html
+++ b/core/templates/jobInfoES.html
@@ -129,7 +129,7 @@
Job error summary: |
- Error description: {{ job.errorinfo|force_escape|safe }} |
+ Error description: {{ job.errorinfo|safe }} |
{% if job.jobdispatchererrorcode or job.brokerageerrorcode or job.ddmerrorcode or job.exeerrorcode or job.piloterrorcode or job.superrorcode or job.taskbuffererrorcode %}
Component | Code | Message |
{% if job.jobdispatchererrorcode %}
diff --git a/core/templates/jobList.html b/core/templates/jobList.html
index ebbf9afc..3bfbca72 100644
--- a/core/templates/jobList.html
+++ b/core/templates/jobList.html
@@ -341,7 +341,7 @@ Overall error summary
{{ job.nevents }} ({{ job.ninputs }}) |
{% if 'maxpssgbpercore' in job and job.maxpssgbpercore %}{{ job.maxpssgbpercore }}{% endif %} |
{% if job.jobinfo != '' %}{{job.jobinfo|force_escape|safe}} {% endif %}
- {% if job.errorinfo != '' %}{{job.errorinfo|force_escape|safe}}{% endif %}
+ {% if job.errorinfo != '' %}{{job.errorinfo|safe}}{% endif %}
|
Job name: {{ job.jobname }} #{{ job.attemptnr }} |
diff --git a/core/templates/jobListES.html b/core/templates/jobListES.html
index 983577cd..258010ed 100644
--- a/core/templates/jobListES.html
+++ b/core/templates/jobListES.html
@@ -311,7 +311,7 @@ Overall error summary
{{ job.currentpriority }} |
{{ job.nevents }} ({{ job.ninputs }}) |
{% if job.jobinfo != '' %}{{job.jobinfo|force_escape|safe}} {% endif %}
- {% if job.errorinfo != '' %}{{job.errorinfo|force_escape|safe}}{% endif %}
+ {% if job.errorinfo != '' %}{{job.errorinfo|safe}}{% endif %}
|
{{ job.esjobstr }} |