Commit 47852174 authored by Sebastien Robin's avatar Sebastien Robin

use escape characters that we can find in html sometimes.

This prevent to break the xml


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@381 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 955c9cf9
...@@ -32,6 +32,7 @@ from cStringIO import StringIO ...@@ -32,6 +32,7 @@ from cStringIO import StringIO
from email.MIMEBase import MIMEBase from email.MIMEBase import MIMEBase
from email import Encoders from email import Encoders
import pickle import pickle
from xml.sax.saxutils import escape, unescape
from zLOG import LOG from zLOG import LOG
...@@ -94,8 +95,10 @@ def Base_asXML(object, ident=0): ...@@ -94,8 +95,10 @@ def Base_asXML(object, ident=0):
if i<len(value): if i<len(value):
xml+='@@@' # XXX very bad hack, must find something better xml+='@@@' # XXX very bad hack, must find something better
i += 1 i += 1
elif self.getPropertyType(prop_id) in ('text','string'): elif self.getPropertyType(prop_id) in ('text','string',):
xml += str(value).replace('\n','@@@') #xml += str(value).replace('\n','@@@')
value = str(value).replace('\n','@@@')
xml += escape(value)
else: else:
xml+= str(value) xml+= str(value)
xml += '</%s>\n' % prop_id xml += '</%s>\n' % prop_id
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment