0002-workflows-use-ezt-escaping-code-for-history-notes-25.patch
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 |
- |