when subscribing, check for valid html content type before checking if requested document has HTML doctype/start element

This commit is contained in:
Andrew Dolgov 2019-05-16 10:07:22 +03:00
parent 9423d72f6c
commit de713035fd
1 changed files with 2 additions and 1 deletions

View File

@ -1131,6 +1131,7 @@ class Feeds extends Handler_Protected {
global $fetch_last_error; global $fetch_last_error;
global $fetch_last_error_content; global $fetch_last_error_content;
global $fetch_last_content_type;
$pdo = Db::pdo(); $pdo = Db::pdo();
@ -1152,7 +1153,7 @@ class Feeds extends Handler_Protected {
return array("code" => 5, "message" => $fetch_last_error); return array("code" => 5, "message" => $fetch_last_error);
} }
if (is_html($contents)) { if (mb_strpos($fetch_last_content_type, "html") !== FALSE && is_html($contents)) {
$feedUrls = get_feeds_from_html($url, $contents); $feedUrls = get_feeds_from_html($url, $contents);
if (count($feedUrls) == 0) { if (count($feedUrls) == 0) {