diff --git a/src/Network/Probe.php b/src/Network/Probe.php index e290553a70..21a190c7df 100644 --- a/src/Network/Probe.php +++ b/src/Network/Probe.php @@ -1715,9 +1715,11 @@ class Probe } $feed = $curlResult->getBodyString(); - $feed_data = Feed::import($feed); + if (strpos($curlResult->getContentType(), 'xml') !== false) { + $feed_data = Feed::import($feed); + } - if (!$feed_data) { + if (empty($feed_data)) { if (!$probe) { return []; } diff --git a/src/Worker/OnePoll.php b/src/Worker/OnePoll.php index a305f85d5e..bde45e3916 100644 --- a/src/Worker/OnePoll.php +++ b/src/Worker/OnePoll.php @@ -188,6 +188,11 @@ class OnePoll return false; } + if (strpos($curlResult->getContentType(), 'xml') !== false) { + Logger::notice('Unexpected content type.', ['id' => $contact['id'], 'url' => $contact['poll'], 'content-type' => $curlResult->getContentType()]); + return false; + } + if (!strstr($xml, '<')) { Logger::notice('response did not contain XML.', ['id' => $contact['id'], 'url' => $contact['poll']]); return false;