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:
authordizzy <diosmosis@users.noreply.github.com>2021-08-04 03:28:15 +0300
committerGitHub <noreply@github.com>2021-08-04 03:28:15 +0300
commit8161ae7ee08577a082a7b9fcd258d9c565eac36c (patch)
tree71ced7572b2cde1242f6cd2aa3462c7f39818da5 /plugins/VisitTime
parent356ffefbb6e606c7f711b6aad06a47b0f575d568 (diff)
If visit local time is null do not fail in report fetch API method (#17801)
Diffstat (limited to 'plugins/VisitTime')
-rw-r--r--plugins/VisitTime/functions.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/plugins/VisitTime/functions.php b/plugins/VisitTime/functions.php
index c916224b2c..6a1993c393 100644
--- a/plugins/VisitTime/functions.php
+++ b/plugins/VisitTime/functions.php
@@ -15,7 +15,12 @@ use Piwik\Piwik;
function getTimeLabel($label)
{
- $date = Date::factory(mktime($label));
+ $time = mktime($label);
+ if (empty($time)) {
+ return Piwik::translate('General_Unknown');
+ }
+
+ $date = Date::factory($time);
$dateTimeProvider = StaticContainer::get('Piwik\Intl\Data\Provider\DateTimeFormatProvider');
if ($dateTimeProvider->uses12HourClock()) {