diff --git a/phpgwapi/inc/class.xmlrpcmsg.inc.php b/phpgwapi/inc/class.xmlrpcmsg.inc.php index 2d5cd08804..181434d436 100644 --- a/phpgwapi/inc/class.xmlrpcmsg.inc.php +++ b/phpgwapi/inc/class.xmlrpcmsg.inc.php @@ -154,13 +154,35 @@ xml_parser_free($parser); return $r; } - // gotta get rid of headers here - if ((!$hdrfnd) && ereg("^(.*)\r\n\r\n",$data,$GLOBALS['_xh'][$parser]['ha'])) + + // if using HTTP, then gotta get rid of HTTP headers here + // and we store them in the 'ha' bit of our data array + if (ereg("^HTTP", $data)) { - $data = ereg_replace("^.*\r\n\r\n", "", $data); - $hdrfnd = 1; + $ar=explode("\r\n", $data); + $newdata = ''; + $hdrfnd = 0; + for ($i=0; $i0) + { + $GLOBALS['_xh'][$parser]['ha'] .= $ar[$i]. "\r\n"; + } + else + { + $hdrfnd=1; + } + } + else + { + $newdata.=$ar[$i] . "\r\n"; + } + } + $data=$newdata; } - + if (!xml_parse($parser, $data, sizeof($data))) { // thanks to Peter Kocks