diff options
author | Matthieu Napoli <matthieu@mnapoli.fr> | 2015-04-20 02:44:23 +0300 |
---|---|---|
committer | Matthieu Napoli <matthieu@mnapoli.fr> | 2015-04-20 02:44:23 +0300 |
commit | 2dd1a7b9ab1b0060065e13f32c2ef22c851f75da (patch) | |
tree | f1571c38be9d1e015a29299920456053d73a26b2 /core/Tracker/Visit | |
parent | 060fe92c83ae9631cab08186b50c25ede88ecb4c (diff) |
#7674 The spammers list is now in a separate repository
Diffstat (limited to 'core/Tracker/Visit')
-rw-r--r-- | core/Tracker/Visit/SpamFilter.php | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/core/Tracker/Visit/SpamFilter.php b/core/Tracker/Visit/SpamFilter.php index 5ec458014d..58af8c31fe 100644 --- a/core/Tracker/Visit/SpamFilter.php +++ b/core/Tracker/Visit/SpamFilter.php @@ -44,19 +44,15 @@ class SpamFilter return $this->spammerList; } - $userFile = StaticContainer::get('path.tmp') . '/spammers.txt'; - if (file_exists($userFile)) { - $this->spammerList = file($userFile, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); + $file = StaticContainer::get('path.tmp') . '/spammers.txt'; + if (!file_exists($file)) { + $file = PIWIK_INCLUDE_PATH . '/vendor/piwik/referrer-spam-blacklist/spammers.txt'; + } - if (!is_array($this->spammerList)) { - throw new \Exception(sprintf('The file %s does not contain a JSON array', $userFile)); - } - } else { - // TODO - $this->spammerList = array( - '4webmasters.org', - '7makemoneyonline.com', - ); + $this->spammerList = file($file, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); + + if (!is_array($this->spammerList)) { + throw new \Exception(sprintf('The file %s does not contain a JSON array', $file)); } return $this->spammerList; |