summaryrefslogtreecommitdiff
path: root/sfeed.c
diff options
context:
space:
mode:
authorHiltjo Posthuma <hiltjo@codemadness.org>2019-06-11 20:50:16 +0200
committerHiltjo Posthuma <hiltjo@codemadness.org>2019-06-11 20:50:16 +0200
commitdfb02b659a44afe34176d010846de5c09992a147 (patch)
tree320be241f1421ea0c179b97c0b6d5ad0882482aa /sfeed.c
parent07a9a6d5c711426af787ffc38d16b9147062ab8a (diff)
optimization: only convert entities when we are inside a RSS/Atom tag
Diffstat (limited to 'sfeed.c')
-rw-r--r--sfeed.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sfeed.c b/sfeed.c
index fc7d2aa..1fb43b6 100644
--- a/sfeed.c
+++ b/sfeed.c
@@ -671,6 +671,11 @@ xmlattrentity(XMLParser *p, const char *t, size_t tl, const char *n, size_t nl,
return;
}
+ if (!ctx.tagid)
+ return;
+
+ /* try to translate entity, else just pass as data to
+ * xmldata handler. */
if ((len = xml_entitytostr(data, buf, sizeof(buf))) > 0)
xmlattr(p, t, tl, n, nl, buf, (size_t)len);
else
@@ -735,7 +740,7 @@ xmldataentity(XMLParser *p, const char *data, size_t datalen)
return;
/* try to translate entity, else just pass as data to
- * xml_data_handler. */
+ * xmldata handler. */
if ((len = xml_entitytostr(data, buf, sizeof(buf))) > 0)
xmldata(p, buf, (size_t)len);
else