}
$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 [];
}
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;