diff options
-rw-r--r-- | plugins/CoreAdminHome/Tasks.php | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/plugins/CoreAdminHome/Tasks.php b/plugins/CoreAdminHome/Tasks.php index 3a5ef5966f..2fe5a83ed9 100644 --- a/plugins/CoreAdminHome/Tasks.php +++ b/plugins/CoreAdminHome/Tasks.php @@ -114,6 +114,13 @@ class Tasks extends \Piwik\Plugin\Tasks $url = 'https://raw.githubusercontent.com/piwik/referrer-spam-blacklist/master/spammers.txt'; $list = Http::sendHttpRequest($url, 30); $list = preg_split("/\r\n|\n|\r/", $list); + if (count($list) < 10) { + throw new \Exception(sprintf( + 'The spammers list downloaded from %s contains less than 10 entries, considering it a fail', + $url + )); + } + Option::set(ReferrerSpamFilter::OPTION_STORAGE_NAME, serialize($list)); } |