From 1e717bf1fea113e84f0468d8b5ea0031e16bfc0a Mon Sep 17 00:00:00 2001 From: Andrew McMillan Date: Fri, 5 Mar 2010 12:25:09 +1300 Subject: [PATCH] Check we have actually got an XML body if we got a content-type XML. --- inc/CalDAVRequest.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/inc/CalDAVRequest.php b/inc/CalDAVRequest.php index 3e7e10aa..c507343e 100644 --- a/inc/CalDAVRequest.php +++ b/inc/CalDAVRequest.php @@ -489,7 +489,13 @@ EOSQL; xml_parser_set_option ( $xml_parser, XML_OPTION_CASE_FOLDING, 0 ); xml_parse_into_struct( $xml_parser, $this->raw_post, $this->xml_tags ); xml_parser_free($xml_parser); - dbg_error_log( "caldav", " Parsed incoming XML request body." ); + if ( count($this->xml_tags) ) { + dbg_error_log( "caldav", " Parsed incoming XML request body." ); + } + else { + $this->xml_tags = null; + dbg_error_log( "ERROR", "Incoming request sent content-type XML with no XML request body." ); + } } /**