diff mod_pubsub_feeds/mod_pubsub_feeds.lua @ 4883:68bd8ae9b827

mod_pubsub_feeds: Allow but ignore XML comments and processing instructions This should allow but ignore them, which should be safe.
author Kim Alvefur <zash@zash.se>
date Fri, 04 Feb 2022 21:22:10 +0100
parents 281a864e7472
children 1f8c9e27b625
line wrap: on
line diff
--- a/mod_pubsub_feeds/mod_pubsub_feeds.lua	Fri Feb 04 16:25:23 2022 +0100
+++ b/mod_pubsub_feeds/mod_pubsub_feeds.lua	Fri Feb 04 21:22:10 2022 +0100
@@ -26,7 +26,7 @@
 local xmlns_atom = "http://www.w3.org/2005/Atom";
 
 local function parse_feed(data)
-	local feed, err = parse_xml(data);
+	local feed, err = parse_xml(data, { allow_processing_instructions = true; allow_comments = true });
 	if not feed then return feed, err; end
 	if feed.attr.xmlns == xmlns_atom then
 		return feed;