Merge 0.6->0.7
authorMatthew Wild <mwild1@gmail.com>
Wed, 1 Jun 2011 23:25:44 +0000 (00:25 +0100)
committerMatthew Wild <mwild1@gmail.com>
Wed, 1 Jun 2011 23:25:44 +0000 (00:25 +0100)
1  2 
core/xmlhandlers.lua

index 47db75d3963c3e8a4c749926586c4504bfe3669b,9e8fd7f6704a00bf4fc4c0ad84440fa1b259dfd2..10f02d0bd67f0ab97a25870c5c83b02d97b22672
@@@ -134,33 -143,18 +134,32 @@@ function init_xmlhandlers(session, stre
                        else
                                stanza:up();
                        end
 +              else
 +                      if tagname == stream_tag then
 +                              if cb_streamclosed then
 +                                      cb_streamclosed(session);
 +                              end
 +                      else
 +                              local curr_ns,name = tagname:match(ns_pattern);
 +                              if name == "" then
 +                                      curr_ns, name = "", curr_ns;
 +                              end
 +                              cb_error(session, "parse-error", "unexpected-element-close", name);
 +                      end
 +                      stanza, chardata = nil, {};
                end
-       xml_handlers.StartCdataSection = restricted_handler;
 +      end
 +
 +      local function restricted_handler()
 +              cb_error(session, "parse-error", "restricted-xml", "Restricted XML, see RFC 6120 section 11.1.");
 +      end
 +
 +      if lxp_supports_doctype then
 +              xml_handlers.StartDoctypeDecl = restricted_handler;
 +      end
 +      xml_handlers.Comment = restricted_handler;
 +      xml_handlers.ProcessingInstruction = restricted_handler;
  
 -              local function restricted_handler()
 -                      cb_error(session, "parse-error", "restricted-xml", "Restricted XML, see RFC 6120 section 11.1.");
 -              end
 -              
 -              if lxp_supports_doctype then
 -                      xml_handlers.StartDoctypeDecl = restricted_handler;
 -              end
 -              xml_handlers.Comment = restricted_handler;
 -              xml_handlers.ProcessingInstruction = restricted_handler;
 -      
        return xml_handlers;
  end