diff options
author | sgiehl <stefan@piwik.org> | 2014-05-20 22:44:41 +0400 |
---|---|---|
committer | sgiehl <stefan@piwik.org> | 2014-05-20 22:44:41 +0400 |
commit | ce3b6eb638d1c3294d4f0a8b63d75395c5b6099d (patch) | |
tree | 3f832e2cffba9d1bbd2b8396b875b9c5778365f3 /core/UrlHelper.php | |
parent | a8780b817a744c41f1e729e8d43764389ab490bf (diff) |
refs #5114 added detection for yahoo! japan; improved handling for search enginge detection
Diffstat (limited to 'core/UrlHelper.php')
-rw-r--r-- | core/UrlHelper.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/core/UrlHelper.php b/core/UrlHelper.php index 2ce26ba165..b99f457f40 100644 --- a/core/UrlHelper.php +++ b/core/UrlHelper.php @@ -286,8 +286,18 @@ class UrlHelper $searchEngines = Common::getSearchEngineUrls(); $hostPattern = self::getLossyUrl($referrerHost); + /* + * Try to get the best matching 'host' in definitions + * 1. check if host + path matches an definition + * 2. check if host only matches + * 3. check if host pattern + path matches + * 4. check if host pattern matches + * 5. special handling + */ if (array_key_exists($referrerHost . $referrerPath, $searchEngines)) { $referrerHost = $referrerHost . $referrerPath; + } elseif (array_key_exists($referrerHost, $searchEngines)) { + // no need to change host } elseif (array_key_exists($hostPattern . $referrerPath, $searchEngines)) { $referrerHost = $hostPattern . $referrerPath; } elseif (array_key_exists($hostPattern, $searchEngines)) { |