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@googlemail.com>2014-09-13 17:29:58 +0400
committerThomas Steur <thomas.steur@googlemail.com>2014-09-13 17:29:58 +0400
commit980ac3aeaa50eb7a14b473534861a69324f36c2e (patch)
treea465b362646f1055637129a050bcde54e5ec2d24 /core/Tracker.php
parent0f12cc9a8725636c04fdfc42bc576f337b8ec2f8 (diff)
refs #4996 allow only hosts of siteIds that are present in the URL and do not allow known hosts automatically both to prevent issues on shared Piwik instances
Diffstat (limited to 'core/Tracker.php')
-rw-r--r--core/Tracker.php20
1 files changed, 13 insertions, 7 deletions
diff --git a/core/Tracker.php b/core/Tracker.php
index a690a31225..4497ec0b99 100644
--- a/core/Tracker.php
+++ b/core/Tracker.php
@@ -929,6 +929,10 @@ class Tracker
return;
}
+ if (empty($this->requests)) {
+ return;
+ }
+
$redirectUrl = $this->getRedirectUrl();
$host = Url::getHostFromUrl($redirectUrl);
@@ -936,8 +940,15 @@ class Tracker
return;
}
- $model = new Model();
- $siteIds = $model->getSitesId();
+ $siteIds = array();
+
+ foreach ($this->requests as $request) {
+ $siteIds[] = (int) $request['idsite'];
+ }
+
+ $siteIds = array_unique($siteIds);
+
+ $model = new Model();
foreach ($siteIds as $siteId) {
$siteUrls = $model->getSiteUrlsFromId($siteId);
@@ -946,11 +957,6 @@ class Tracker
Url::redirectToUrl($redirectUrl);
}
}
-
- $trustedHosts = Url::getTrustedHosts();
- if (Url::isHostInUrls($host, $trustedHosts)) {
- Url::redirectToUrl($redirectUrl);
- }
}