|
@@ 1299-1314 (lines=16) @@
|
| 1296 |
|
$data = $this->incoming_payload; |
| 1297 |
|
//print "data: <xmp>$data</xmp>"; |
| 1298 |
|
// separate content from HTTP headers |
| 1299 |
|
if(preg_match("/([^<]*?)\r?\n\r?\n(<.*>)/s",$data,$result)) { |
| 1300 |
|
$this->debug("found proper separation of headers and document"); |
| 1301 |
|
$this->debug("getting rid of headers, stringlen: ".strlen($data)); |
| 1302 |
|
$clean_data = $result[2]; |
| 1303 |
|
$this->debug("cleaned data, stringlen: ".strlen($clean_data)); |
| 1304 |
|
/* |
| 1305 |
|
if(preg_match("/^(.*)\r?\n\r?\n/",$data)) { |
| 1306 |
|
$this->debug("found proper separation of headers and document"); |
| 1307 |
|
$this->debug("getting rid of headers, stringlen: ".strlen($data)); |
| 1308 |
|
$clean_data = preg_replace("/^[^<]*\r\n\r\n/","", $data); |
| 1309 |
|
$this->debug("cleaned data, stringlen: ".strlen($clean_data)); |
| 1310 |
|
*/ |
| 1311 |
|
} else { |
| 1312 |
|
$this->setError('no proper separation of headers and document.'); |
| 1313 |
|
return false; |
| 1314 |
|
} |
| 1315 |
|
if(strlen($clean_data) == 0){ |
| 1316 |
|
$this->debug("no data after headers!"); |
| 1317 |
|
$this->setError("no data present after HTTP headers."); |
|
@@ 1401-1409 (lines=9) @@
|
| 1398 |
|
curl_close($ch); |
| 1399 |
|
|
| 1400 |
|
// separate content from HTTP headers |
| 1401 |
|
if(preg_match("/^(.*)\r?\n\r?\n/",$data)) { |
| 1402 |
|
$this->debug("found proper separation of headers and document"); |
| 1403 |
|
$this->debug("getting rid of headers, stringlen: ".strlen($data)); |
| 1404 |
|
$clean_data = preg_replace("/^[^<]*\r\n\r\n/","", $data); |
| 1405 |
|
$this->debug("cleaned data, stringlen: ".strlen($clean_data)); |
| 1406 |
|
} else { |
| 1407 |
|
$this->setError('no proper separation of headers and document.'); |
| 1408 |
|
return false; |
| 1409 |
|
} |
| 1410 |
|
if(strlen($clean_data) == 0){ |
| 1411 |
|
$this->debug("no data after headers!"); |
| 1412 |
|
$this->setError("no data present after HTTP headers."); |