diff options
author | dizzy <diosmosis@users.noreply.github.com> | 2021-08-04 03:28:15 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-04 03:28:15 +0300 |
commit | 8161ae7ee08577a082a7b9fcd258d9c565eac36c (patch) | |
tree | 71ced7572b2cde1242f6cd2aa3462c7f39818da5 /plugins | |
parent | 356ffefbb6e606c7f711b6aad06a47b0f575d568 (diff) |
If visit local time is null do not fail in report fetch API method (#17801)
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/VisitTime/functions.php | 7 |
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()) { |