ignore malformed xml before it hits the parser.
This commit is contained in:
parent
2ef6ad80a4
commit
e09d164882
|
@ -115,6 +115,7 @@
|
|||
|
||||
logger('poller: handshake with url ' . $url . ' returns xml: ' . $xml, LOGGER_DATA);
|
||||
|
||||
|
||||
if(! $xml) {
|
||||
logger("poller: $url appears to be dead - marking for death ");
|
||||
// dead connection - might be a transient event, or this might
|
||||
|
@ -132,6 +133,15 @@
|
|||
continue;
|
||||
}
|
||||
|
||||
if(! strstr($xml,'<?xml')) {
|
||||
logger('poller: response from ' . $url . ' did not contain XML.');
|
||||
$r = q("UPDATE `contact` SET `last-update` = '%s' WHERE `id` = %d LIMIT 1",
|
||||
dbesc(datetime_convert()),
|
||||
intval($contact['id'])
|
||||
);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
$res = simplexml_load_string($xml);
|
||||
|
||||
|
|
Loading…
Reference in a new issue