af_redditimgur: don't try to check if null domain is blacklisted

This commit is contained in:
Andrew Dolgov 2022-07-27 07:14:24 +03:00
parent 7c45b3f789
commit 4e02dc0ab5
No known key found for this signature in database
GPG Key ID: 1A56B4FA25D4AF2A
1 changed files with 5 additions and 4 deletions

View File

@ -936,11 +936,12 @@ class Af_RedditImgur extends Plugin {
private function is_blacklisted(string $src, array $also_blacklist = []) : bool { private function is_blacklisted(string $src, array $also_blacklist = []) : bool {
$src_domain = parse_url($src, PHP_URL_HOST); $src_domain = parse_url($src, PHP_URL_HOST);
foreach (array_merge($this->domain_blacklist, $also_blacklist) as $domain) { if ($src_domain)
if (strstr($src_domain, $domain) !== false) { foreach (array_merge($this->domain_blacklist, $also_blacklist) as $domain) {
return true; if (strstr($src_domain, $domain) !== false) {
return true;
}
} }
}
return false; return false;
} }