Fix raw_post handling for other front-ends.

Signed-off-by: Andrew McMillan <andrew@morphoss.com>
This commit is contained in:
Andrew McMillan 2011-04-03 21:34:59 +12:00
parent ba1e80d185
commit d83d7a0ef2
2 changed files with 4 additions and 2 deletions

View File

@ -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();

View File

@ -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'];