Merge 0.8->trunk
[prosody.git] / util / xmppstream.lua
index f92c5ffa29a26b2706ab8b6e083d026bb7475555..e5271b7242a91a76024b68027c769cab9dabc949 100644 (file)
@@ -167,16 +167,18 @@ function new_sax_handlers(session, stream_callbacks)
                        stack = {};
                end
        end
-       
-       local function restricted_handler()
+
+       local function restricted_handler(parser)
                cb_error(session, "parse-error", "restricted-xml", "Restricted XML, see RFC 6120 section 11.1.");
+               if not parser.stop or not parser:stop() then
+                       error("Failed to abort parsing");
+               end
        end
        
        if lxp_supports_doctype then
                xml_handlers.StartDoctypeDecl = restricted_handler;
        end
        xml_handlers.Comment = restricted_handler;
-       xml_handlers.StartCdataSection = restricted_handler;
        xml_handlers.ProcessingInstruction = restricted_handler;
        
        local function reset()