From acb1bc2feb4ce0c2ed06f50cca7c57aa914402e8 Mon Sep 17 00:00:00 2001 From: mattab Date: Mon, 12 May 2014 09:42:39 +1200 Subject: [PATCH] Actually call the Referrer Spam check. Fixes #2268 Refs #5099 --- core/Tracker/VisitExcluded.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/core/Tracker/VisitExcluded.php b/core/Tracker/VisitExcluded.php index 8ca1e2fbaa3..0cd3ef9fa0e 100644 --- a/core/Tracker/VisitExcluded.php +++ b/core/Tracker/VisitExcluded.php @@ -111,6 +111,14 @@ public function isExcluded() } } + // Check if Referrer URL is a known spam + if (!$excluded) { + $excluded = $this->isReferrerSpamExcluded(); + if ($excluded) { + Common::printDebug("Referrer URL is blacklisted as spam."); + } + } + if (!$excluded) { if ($this->isPrefetchDetected()) { $excluded = true; @@ -256,6 +264,7 @@ protected function isReferrerSpamExcluded() $referrerUrl = $this->request->getParam('urlref'); foreach($spamHosts as $spamHost) { if( strpos($referrerUrl, $spamHost) !== false) { + Common::printDebug('Referrer URL is a known spam: ' . $spamHost); return true; } }