Name Format strings can have XML in them; now escaped- prevented valid XML from being written
svn: r15692
This commit is contained in:
parent
3d19491f40
commit
02dc2ce868
@ -81,7 +81,11 @@ except:
|
|||||||
strip_dict = dict.fromkeys(range(9)+range(12,20))
|
strip_dict = dict.fromkeys(range(9)+range(12,20))
|
||||||
|
|
||||||
def escxml(d):
|
def escxml(d):
|
||||||
return escape(d, { '"' : '"' } )
|
return escape(d,
|
||||||
|
{'"' : '"',
|
||||||
|
'<' : '<',
|
||||||
|
'>' : '>',
|
||||||
|
})
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
@ -375,7 +379,8 @@ class GrampsXmlWriter(UpdateCallback):
|
|||||||
for number, name,fmt_str,active in self.db.name_formats:
|
for number, name,fmt_str,active in self.db.name_formats:
|
||||||
self.g.write('%s<format number="%d" name="%s" '
|
self.g.write('%s<format number="%d" name="%s" '
|
||||||
'fmt_str="%s" active="%d"/>\n'
|
'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")
|
self.g.write(" </name-formats>\n")
|
||||||
|
|
||||||
def fix(self,line):
|
def fix(self,line):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user