diff options
author | mattab <matthieu.aubry@gmail.com> | 2013-12-11 05:47:21 +0400 |
---|---|---|
committer | mattab <matthieu.aubry@gmail.com> | 2013-12-11 05:47:21 +0400 |
commit | 4726aa6ebb61b8b423deea779968bcab3b2051dd (patch) | |
tree | dab3645916271675c62bc5e7ac36d5ee8e9a1531 /plugins/CoreAdminHome | |
parent | efc5e7ba75410048df1d25d57cbf2321470458fd (diff) |
Fix cron error when date is invalid
Diffstat (limited to 'plugins/CoreAdminHome')
-rw-r--r-- | plugins/CoreAdminHome/CoreAdminHome.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/plugins/CoreAdminHome/CoreAdminHome.php b/plugins/CoreAdminHome/CoreAdminHome.php index ca63983d01..9a5d9a50ae 100644 --- a/plugins/CoreAdminHome/CoreAdminHome.php +++ b/plugins/CoreAdminHome/CoreAdminHome.php @@ -117,7 +117,11 @@ class CoreAdminHome extends \Piwik\Plugin foreach ($archiveTables as $table) { $date = ArchiveTableCreator::getDateFromTableName($table); list($year, $month) = explode('_', $date); - ArchiveSelector::purgeOutdatedArchives(Date::factory("$year-$month-15")); + + // Somehow we may have archive tables created with older dates, prevent exception from being thrown + if($year > 1990) { + ArchiveSelector::purgeOutdatedArchives(Date::factory("$year-$month-15")); + } } } |