diff --git a/inc/CalDAVRequest.php b/inc/CalDAVRequest.php index b6463f38..46ef5799 100644 --- a/inc/CalDAVRequest.php +++ b/inc/CalDAVRequest.php @@ -515,6 +515,9 @@ EOSQL; * should reasonably expect to see either text/xml or application/xml */ if ( isset($this->content_type) && preg_match( '#(application|text)/xml#', $this->content_type ) ) { + if ( !isset($this->raw_post) || $this->raw_post == '' ) { + $this->XMLResponse( 400, new XMLElement( 'error', new XMLElement('missing-xml'), array( 'xmlns' => 'DAV:') ) ); + } $xml_parser = xml_parser_create_ns('UTF-8'); $this->xml_tags = array(); xml_parser_set_option ( $xml_parser, XML_OPTION_SKIP_WHITE, 1 ); diff --git a/testing/tests/regression-suite/0949-MKTICKET.result b/testing/tests/regression-suite/0949-MKTICKET.result index f15646ad..b23db8bc 100644 --- a/testing/tests/regression-suite/0949-MKTICKET.result +++ b/testing/tests/regression-suite/0949-MKTICKET.result @@ -2,13 +2,13 @@ HTTP/1.1 400 Bad Request Date: Dow, 01 Jan 2000 00:00:00 GMT DAV: 1, 2, 3, access-control, calendar-access, calendar-schedule DAV: extended-mkcol, calendar-proxy, bind, addressbook, calendar-auto-schedule -ETag: "7bc3d8a76fb705dfff8a6654bb8d7fb8" -Content-Length: 155 +ETag: "4ec54351d43b4404acdf28263d694a2b" +Content-Length: 86 Content-Type: text/xml; charset="utf-8" - - + + dav_owner_id: >1002<