diff options
-rw-r--r-- | core/Date.php | 6 | ||||
-rw-r--r-- | core/Updates/2.16.5.php (renamed from core/Updates/2.16.3-b3.php) | 8 | ||||
-rw-r--r-- | core/Version.php | 2 |
3 files changed, 10 insertions, 6 deletions
diff --git a/core/Date.php b/core/Date.php index f4a76cf0dc..43628cf93c 100644 --- a/core/Date.php +++ b/core/Date.php @@ -258,7 +258,7 @@ class Date } /** - * Converts a timestamp in a from UTC to a timezone. + * Converts a timestamp from UTC to a timezone. * * @param int $timestamp The UNIX timestamp to adjust. * @param string $timezone The timezone to adjust to. @@ -266,6 +266,10 @@ class Date */ public static function adjustForTimezone($timestamp, $timezone) { + if (empty($timezone)) { + return $timestamp; + } + // manually adjust for UTC timezones $utcOffset = self::extractUtcOffset($timezone); if ($utcOffset !== false) { diff --git a/core/Updates/2.16.3-b3.php b/core/Updates/2.16.5.php index ba57839d57..c5aef85066 100644 --- a/core/Updates/2.16.3-b3.php +++ b/core/Updates/2.16.5.php @@ -16,19 +16,19 @@ use Piwik\Updater; use Piwik\Updates as PiwikUpdates; /** - * Update for version 2.16.3-b3. + * Update for version 2.16.5. * * Update existing scheduled reports to use UTC timezone for hour setting */ -class Updates_2_16_3_b3 extends PiwikUpdates +class Updates_2_16_5 extends PiwikUpdates { public function doUpdate(Updater $updater) { $model = new ScheduledReportsModel(); $allReports = ScheduledReportsAPI::getInstance()->getReports(); foreach ($allReports as $report) { - $report['hour'] = $this->adjustTimezoneBySite($report['hour'], $report['idsite']); - $model->updateReport($report['idreport'], $report); + $update = array('hour' => $this->adjustTimezoneBySite($report['hour'], $report['idsite'])); + $model->updateReport($report['idreport'], $update); } } diff --git a/core/Version.php b/core/Version.php index f68077cc25..5d2fa32109 100644 --- a/core/Version.php +++ b/core/Version.php @@ -20,7 +20,7 @@ final class Version * The current Piwik version. * @var string */ - const VERSION = '2.16.4'; + const VERSION = '2.16.5'; public function isStableVersion($version) { |