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
path: root/core
diff options
context:
space:
mode:
authorKate Butler <kate@innocraft.com>2019-04-16 04:12:05 +0300
committerThomas Steur <tsteur@users.noreply.github.com>2019-04-16 04:12:05 +0300
commit6a1442fa320cdeea1b96a08c00f622d47bedc354 (patch)
tree35c30fd022c361367215a1e68c2ef00cb1224d2b /core
parentfc8b08c3f5152a2e0785a2ccbb1fffc5d209c0df (diff)
Fix archive invalidation timezone issue in tracker (#14318)
* Fix timezone bug in PHP tracker archive invalidation * Reset timezone after each unit test * Fix timezone issue in unit test * More elegant method for getting midnight in UTC+5
Diffstat (limited to 'core')
-rw-r--r--core/Tracker/Visit.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/core/Tracker/Visit.php b/core/Tracker/Visit.php
index f768ed6190..25ff938562 100644
--- a/core/Tracker/Visit.php
+++ b/core/Tracker/Visit.php
@@ -557,7 +557,11 @@ class Visit implements VisitInterface
$date = Date::factory((int)$time, $timezone);
- if (!$date->isToday()) { // we don't have to handle in case date is in future as it is not allowed by tracker
+ // $date->isToday() is buggy when server and website timezones don't match - so we'll do our own checking
+ $startOfToday = Date::factoryInTimezone('today', $timezone);
+ $isToday = $date->toString('Y-m-d') === $startOfToday->toString('Y-m-d');
+
+ if (!$isToday) { // we don't have to handle in case date is in future as it is not allowed by tracker
$this->invalidator->rememberToInvalidateArchivedReportsLater($idSite, $date);
}
}