mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-13 14:05:56 +00:00
fetch_file_contents: resolve requested hosts and check for possible
loopback address
This commit is contained in:
@@ -243,6 +243,13 @@
|
||||
if (!$url) return false;
|
||||
|
||||
$url_host = parse_url($url, PHP_URL_HOST);
|
||||
$ip_addr = gethostbyname($url_host);
|
||||
|
||||
if (!$ip_addr || strpos($ip_addr, "127.0") === 0) {
|
||||
$fetch_last_error = "URL hostname failed to resolve or resolved to loopback address ($ip_addr)";
|
||||
return false;
|
||||
}
|
||||
|
||||
$fetch_domain_hits[$url_host] += 1;
|
||||
|
||||
/*if ($fetch_domain_hits[$url_host] > MAX_FETCH_REQUESTS_PER_HOST) {
|
||||
|
||||
Reference in New Issue
Block a user