diff --git a/htdocs/caldav.php b/htdocs/caldav.php index 6c77304a..1bdff495 100644 --- a/htdocs/caldav.php +++ b/htdocs/caldav.php @@ -41,13 +41,14 @@ function logRequestHeaders() { dbg_error_log( "LOG ", "******************** Request ********************" ); // Log the request in all it's gory detail. - $lines = preg_split( '#[\r\n]+#', file_get_contents( 'php://input')); + $lines = preg_split( '#[\r\n]+#', $c->raw_post ); foreach( $lines AS $v ) { dbg_error_log( "LOG request", "-->%s", $v ); } unset($lines); } +if ( !isset($c->raw_post) ) $c->raw_post = file_get_contents( 'php://input'); if ( (isset($c->dbg['ALL']) && $c->dbg['ALL']) || (isset($c->dbg['request']) && $c->dbg['request']) ) logRequestHeaders(); diff --git a/inc/CalDAVRequest.php b/inc/CalDAVRequest.php index b7b8f38d..fe795fc7 100644 --- a/inc/CalDAVRequest.php +++ b/inc/CalDAVRequest.php @@ -109,7 +109,8 @@ class CalDAVRequest $this->options = $options; if ( !isset($this->options['allow_by_email']) ) $this->options['allow_by_email'] = false; - $this->raw_post = file_get_contents( 'php://input'); + if ( !isset($c->raw_post) ) $c->raw_post = file_get_contents( 'php://input'); + $this->raw_post = $c->raw_post; if ( isset($debugging) && isset($_GET['method']) ) { $_SERVER['REQUEST_METHOD'] = $_GET['method'];