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,11 +154,33 @@
xml_parser_free($parser); xml_parser_free($parser);
return $r; 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); $ar=explode("\r\n", $data);
$hdrfnd = 1; $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))) if (!xml_parse($parser, $data, sizeof($data)))