Projet

Général

Profil

0002-workflows-use-ezt-escaping-code-for-history-notes-25.patch

Frédéric Péters, 28 juillet 2018 15:05

Télécharger (1,27 ko)

Voir les différences:

Subject: [PATCH 2/3] workflows: use ezt escaping code for history notes
 (#25521)

 wcs/wf/register_comment.py | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
wcs/wf/register_comment.py
16 16

  
17 17
import cgi
18 18

  
19
from qommon import _
19
from qommon import _, ezt
20 20
from qommon.form import *
21 21
from qommon.template import TemplateError
22 22
from qommon import get_logger
......
41 41

  
42 42
        if message.startswith('<'):
43 43
            # treat it as html, escape strings from ezt variables
44
            def escape(x):
45
                if isinstance(x, basestring):
46
                    return cgi.escape(x)
47
                return x
48
            self.content = template_on_formdata(formdata, message, process=escape)
44
            self.content = template_on_formdata(formdata, message,
45
                    ezt_format=ezt.FORMAT_HTML)
49 46
            return
50 47

  
51 48
        # treat is as text/plain
52
-