Name Format strings can have XML in them; now escaped- prevented valid XML from being written

svn: r15692
This commit is contained in:
Doug Blank 2010-08-09 13:17:38 +00:00
parent 3d19491f40
commit 02dc2ce868

View File

@ -81,7 +81,11 @@ except:
strip_dict = dict.fromkeys(range(9)+range(12,20))
def escxml(d):
return escape(d, { '"' : '"' } )
return escape(d,
{'"' : '"',
'<' : '&lt;',
'>' : '&gt;',
})
#-------------------------------------------------------------------------
#
@ -375,7 +379,8 @@ class GrampsXmlWriter(UpdateCallback):
for number, name,fmt_str,active in self.db.name_formats:
self.g.write('%s<format number="%d" name="%s" '
'fmt_str="%s" active="%d"/>\n'
% (' ', number, name, fmt_str, int(active)) )
% (' ', number,
escxml(name), escxml(fmt_str), int(active)) )
self.g.write(" </name-formats>\n")
def fix(self,line):