summaryrefslogtreecommitdiff
path: root/gdata/gdata-access-rule.c
diff options
context:
space:
mode:
authorPhilip Withnall <philip@tecnocode.co.uk>2010-12-10 17:45:20 +0000
committerPhilip Withnall <philip@tecnocode.co.uk>2010-12-10 17:45:20 +0000
commit56b33358f94c325dca0fee75a9028247ef5ad896 (patch)
tree6379fbfe087f052dff4f61427841ad7be5ed5db9 /gdata/gdata-access-rule.c
parent87d003808596109dbb7ab4bf6f946898a9a53c0e (diff)
downloadlibgdata-56b33358f94c325dca0fee75a9028247ef5ad896.tar.gz
core: Fix attribute escaping for GDataAccessRule
Helps: bgo#631033
Diffstat (limited to 'gdata/gdata-access-rule.c')
-rw-r--r--gdata/gdata-access-rule.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/gdata/gdata-access-rule.c b/gdata/gdata-access-rule.c
index d6a67f6e..9386d575 100644
--- a/gdata/gdata-access-rule.c
+++ b/gdata/gdata-access-rule.c
@@ -330,16 +330,19 @@ get_xml (GDataParsable *parsable, GString *xml_string)
/* Chain up to the parent class */
GDATA_PARSABLE_CLASS (gdata_access_rule_parent_class)->get_xml (parsable, xml_string);
- if (priv->role != NULL)
+ if (priv->role != NULL) {
/* gAcl:role */
- g_string_append_printf (xml_string, "<gAcl:role value='%s'/>", priv->role);
+ gdata_parser_string_append_escaped (xml_string, "<gAcl:role value='", priv->role, "'/>");
+ }
- if (priv->scope_value != NULL){
+ if (priv->scope_value != NULL) {
/* gAcl:scope */
- if (priv->scope_type != NULL)
- g_string_append_printf (xml_string, "<gAcl:scope type='%s' value='%s'/>", priv->scope_type, priv->scope_value);
- else
- g_string_append_printf (xml_string, "<gAcl:scope value='%s'/>", priv->scope_value);
+ if (priv->scope_type != NULL) {
+ gdata_parser_string_append_escaped (xml_string, "<gAcl:scope type='", priv->scope_type, "'");
+ gdata_parser_string_append_escaped (xml_string, " value='", priv->scope_value, "'/>");
+ } else {
+ gdata_parser_string_append_escaped (xml_string, "<gAcl:scope value='", priv->scope_value, "'/>");
+ }
}
}