update_rss_feed: log effective URL after fetching

validate_url: treat scheme as case-insensitive
This commit is contained in:
Andrew Dolgov 2020-09-21 20:26:57 +03:00
parent 486f1d84ed
commit 4785f21316
2 changed files with 5 additions and 2 deletions

View File

@ -410,7 +410,10 @@ class RSSUtils {
$feed_data = trim($feed_data);
global $fetch_effective_url;
Debug::log("fetch done.", Debug::$LOG_VERBOSE);
Debug::log("effective URL (after redirects): " . clean($fetch_effective_url), Debug::$LOG_VERBOSE);
Debug::log("source last modified: " . $fetch_last_modified, Debug::$LOG_VERBOSE);
if ($feed_data && $fetch_last_modified != $stored_last_modified) {

View File

@ -1980,14 +1980,14 @@
if (!$tokens['host'])
return false;
if (!in_array($tokens['scheme'], ['http', 'https']))
if (!in_array(strtolower($tokens['scheme']), ['http', 'https']))
return false;
if ($extended_filtering) {
if (!in_array($tokens['port'], [80, 443, '']))
return false;
if ($tokens['host'] == 'localhost' || $tokens['host'] == '::1' || strpos($tokens['host'], '127.') === 0)
if (strtolower($tokens['host']) == 'localhost' || $tokens['host'] == '::1' || strpos($tokens['host'], '127.') === 0)
return false;
}