diff options
author | Matthieu Napoli <matthieu@mnapoli.fr> | 2015-06-24 16:42:13 +0300 |
---|---|---|
committer | Matthieu Napoli <matthieu@mnapoli.fr> | 2015-06-24 22:22:03 +0300 |
commit | 9c29520e7fed3310a94efdffaca22dab1536d82c (patch) | |
tree | d5657e5c5af1398fd834bdd160f821b64a162dd9 /plugins | |
parent | bba055c254bd0a4566a0720991fa9e1637ced648 (diff) |
Sanity check #8186
Diffstat (limited to 'plugins')
-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)); } |