summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Richtsfeld <robin.richtsfeld@gmail.com>2018-07-11 20:14:13 +0200
committerRichard Hughes <richard@hughsie.com>2018-07-11 19:33:21 +0100
commitd4fffd203144efa83c2f66a844fbbda59d22b4ad (patch)
tree98e25e4aebe5123072fa6c0f6ff713204dac2b6b
parent1e574413d3700322ddf3ecf40bd7aeec1080211d (diff)
downloadappstream-glib-d4fffd203144efa83c2f66a844fbbda59d22b4ad.tar.gz
Escape quotes in attributes
-rw-r--r--libappstream-glib/as-node.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libappstream-glib/as-node.c b/libappstream-glib/as-node.c
index 7036136..f0d13fc 100644
--- a/libappstream-glib/as-node.c
+++ b/libappstream-glib/as-node.c
@@ -343,6 +343,8 @@ as_node_get_attr_string (AsNodeData *data)
as_utils_string_replace (value_safe, "&", "&amp;");
as_utils_string_replace (value_safe, "<", "&lt;");
as_utils_string_replace (value_safe, ">", "&gt;");
+ as_utils_string_replace (value_safe, "\"", "&quot;");
+ as_utils_string_replace (value_safe, "'", "&apos;");
g_string_append_printf (str, " %s=\"%s\"",
attr->key, value_safe->str);
}