diff --git a/inc/CalDAVRequest.php b/inc/CalDAVRequest.php index 81282d3b..20d26ece 100644 --- a/inc/CalDAVRequest.php +++ b/inc/CalDAVRequest.php @@ -891,17 +891,30 @@ EOSQL; */ function RenderSupportedMethods( ) { global $reply; - $methods = array(); + $methods = new XMLElement('supported-method-set'); foreach( $this->supported_methods AS $k => $v ) { dbg_error_log( 'caldav', 'Adding method "%s" which is "%s".', $k, $v ); - $method = new XMLElement('method'); - $reply->NSElement($method,$k); - $methods[] = new XMLElement('supported-method',$method); + $reply->NSElement( $methods, 'DAV::supported-method', null, array('name' => $k) ); } return $methods; } + /** + * Returns the array of supported methods converted into XMLElements + */ + function RenderSupportedReports( ) { + global $reply; + $reports = array(); + foreach( $this->supported_reports AS $k => $v ) { + dbg_error_log( 'caldav', 'Adding supported report "%s" which is "%s".', $k, $v ); + $report = new XMLElement('supported-report'); + $reply->NSElement($report, $k ); + } + return new XMLElement('supported-report-set', $reports); + } + + /** * Return general server-related properties for this URL */ @@ -1100,7 +1113,8 @@ EOSQL; } } - echo translate($message); + header( "Content-Length: ".strlen($message) ); + echo $message; if ( strlen($message) > 100 || strstr($message, "\n") ) { $message = substr( preg_replace("#\s+#m", ' ', $message ), 0, 100) . (strlen($message) > 100 ? "..." : "");