Merge in Edd Dumbill's changes to header parsing in release 1.02 of xmlrpc for php;

Now allows whitespace in the xml itself
This commit is contained in:
Miles Lott 2001-11-30 03:59:21 +00:00
parent b65f4bcb29
commit a9e47b31f0

View File

@ -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; $i<sizeof($ar); $i++)
{
if (!$hdrfnd)
{
if (strlen($ar[$i])>0)
{
$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 <peter.kocks@baygate.com>