diff options
Diffstat (limited to 'plugins')
-rwxr-xr-x | plugins/af_comics/init.php | 5 | ||||
-rwxr-xr-x | plugins/af_redditimgur/init.php | 8 | ||||
-rwxr-xr-x | plugins/cache_starred_images/init.php | 8 |
3 files changed, 12 insertions, 9 deletions
diff --git a/plugins/af_comics/init.php b/plugins/af_comics/init.php index a9a8f3faa..0649cf92c 100755 --- a/plugins/af_comics/init.php +++ b/plugins/af_comics/init.php @@ -19,7 +19,10 @@ class Af_Comics extends Plugin { require_once __DIR__ . "/filter_base.php"; - $filters = array_merge(glob(__DIR__ . "/filters.local/*.php"), glob(__DIR__ . "/filters/*.php")); + $filters = [ + ...(glob(__DIR__ . "/filters.local/*.php") ?: []), + ...(glob(__DIR__ . "/filters/*.php") ?: []), + ]; $names = []; foreach ($filters as $file) { diff --git a/plugins/af_redditimgur/init.php b/plugins/af_redditimgur/init.php index 8a0d7d99e..898f0b49c 100755 --- a/plugins/af_redditimgur/init.php +++ b/plugins/af_redditimgur/init.php @@ -376,11 +376,11 @@ class Af_RedditImgur extends Plugin { } if ($post_is_nsfw && count($apply_nsfw_tags) > 0) { - $article["tags"] = array_merge($article["tags"], $apply_nsfw_tags); + array_push($article["tags"], ...$apply_nsfw_tags); } if (count($link_flairs) > 0) { - $article["tags"] = array_merge($article["tags"], FeedItem_Common::normalize_categories($link_flairs)); + array_push($article["tags"], ...FeedItem_Common::normalize_categories($link_flairs)); } $article["num_comments"] = $num_comments; @@ -903,7 +903,7 @@ class Af_RedditImgur extends Plugin { // do not try to embed posts linking back to other reddit posts // readability.php requires PHP 5.6 - if ($url && strpos($url, "reddit.com") === false && version_compare(PHP_VERSION, '5.6.0', '>=')) { + if ($url && strpos($url, "reddit.com") === false) { /* link may lead to a huge video file or whatever, we need to check content type before trying to parse it which p much requires curl */ @@ -937,7 +937,7 @@ class Af_RedditImgur extends Plugin { $src_domain = parse_url($src, PHP_URL_HOST); if ($src_domain) - foreach (array_merge($this->domain_blacklist, $also_blacklist) as $domain) { + foreach ([...$this->domain_blacklist, ...$also_blacklist] as $domain) { if (strstr($src_domain, $domain) !== false) { return true; } diff --git a/plugins/cache_starred_images/init.php b/plugins/cache_starred_images/init.php index feec81d62..eed5264c6 100755 --- a/plugins/cache_starred_images/init.php +++ b/plugins/cache_starred_images/init.php @@ -84,10 +84,10 @@ class Cache_Starred_Images extends Plugin { Debug::log("expiring {$this->cache->get_dir()} and {$this->cache_status->get_dir()}..."); - $files = array_merge( - glob($this->cache->get_dir() . "/*-*"), - glob($this->cache_status->get_dir() . "/*.status") - ); + $files = [ + ...(glob($this->cache->get_dir() . "/*-*") ?: []), + ...(glob($this->cache_status->get_dir() . "/*.status") ?: []), + ]; asort($files); |