From de713035fd96684cf8817b8cf0e5a980690ca260 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 16 May 2019 10:07:22 +0300 Subject: when subscribing, check for valid html content type before checking if requested document has HTML doctype/start element --- classes/feeds.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'classes/feeds.php') diff --git a/classes/feeds.php b/classes/feeds.php index 03f13539f..c3a2098b5 100755 --- a/classes/feeds.php +++ b/classes/feeds.php @@ -1131,6 +1131,7 @@ class Feeds extends Handler_Protected { global $fetch_last_error; global $fetch_last_error_content; + global $fetch_last_content_type; $pdo = Db::pdo(); @@ -1152,7 +1153,7 @@ class Feeds extends Handler_Protected { 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); if (count($feedUrls) == 0) { -- cgit v1.2.3