aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2010-12-02 18:32:46 -0800
committerFriendika <info@friendika.com>2010-12-02 18:32:46 -0800
commite09d164882677ed316ef2ea3ee1c8c361c761d90 (patch)
tree5dd839f8b5a63633fc04e4dac25a671fcf91cf3f
parent2ef6ad80a4f7374e0488b8b10b8139e3392f81ff (diff)
downloadvolse-hubzilla-e09d164882677ed316ef2ea3ee1c8c361c761d90.tar.gz
volse-hubzilla-e09d164882677ed316ef2ea3ee1c8c361c761d90.tar.bz2
volse-hubzilla-e09d164882677ed316ef2ea3ee1c8c361c761d90.zip
ignore malformed xml before it hits the parser.
-rw-r--r--include/poller.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/poller.php b/include/poller.php
index d97584ff9..ec1fef7a8 100644
--- a/include/poller.php
+++ b/include/poller.php
@@ -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);