Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Steur <thomas.steur@gmail.com>2015-12-07 00:47:49 +0300
committerThomas Steur <thomas.steur@gmail.com>2015-12-07 00:47:49 +0300
commitaf5738f4afe54b8a911a4ee0bdf22feae6edac9a (patch)
tree4093a9fb0dd1ec2a54c0de2e5c5cba7caacaa29f /plugins/SitesManager/SiteUrls.php
parentde906b60f76f5983e5ee22c79b5d57d4bb144e99 (diff)
refs #9320 when detecting the referrer name, consider a path of a different website if possible and not only domain
Diffstat (limited to 'plugins/SitesManager/SiteUrls.php')
-rw-r--r--plugins/SitesManager/SiteUrls.php21
1 files changed, 21 insertions, 0 deletions
diff --git a/plugins/SitesManager/SiteUrls.php b/plugins/SitesManager/SiteUrls.php
index 059521a4a9..33e2e4844a 100644
--- a/plugins/SitesManager/SiteUrls.php
+++ b/plugins/SitesManager/SiteUrls.php
@@ -110,6 +110,27 @@ class SiteUrls
return $matchingSites;
}
+ public function getPathMatchingUrl($parsedUrl, $urlsGroupedByHost)
+ {
+ if (empty($parsedUrl['host'])) {
+ return null;
+ }
+
+ $urlHost = $this->toCanonicalHost($parsedUrl['host']);
+ $urlPath = $this->getCanonicalPathFromParsedUrl($parsedUrl);
+
+ $matchingSites = null;
+ if (isset($urlsGroupedByHost[$urlHost])) {
+ $paths = $urlsGroupedByHost[$urlHost];
+
+ foreach ($paths as $path => $idSites) {
+ if (0 === strpos($urlPath, $path)) {
+ return $path;
+ }
+ }
+ }
+ }
+
public function getAllCachedSiteUrls()
{
$cache = $this->getCache();