Skip to content

Commit

Permalink
Fixed PHP8.2 deprecated warning in Mage_Cron_Model_Observer (#3253)
Browse files Browse the repository at this point in the history
Co-authored-by: Ng Kiat Siong <kiatsiong.ng@gmail.com>
  • Loading branch information
fballiano and kiatng committed May 23, 2023
1 parent 68cb9ec commit 90fefd7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/code/core/Mage/Cron/Model/Observer.php
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,9 @@ public function cleanup()

$now = time();
foreach ($history->getIterator() as $record) {
if (strtotime($record->getExecutedAt()) < $now - $historyLifetimes[$record->getStatus()]) {
if (empty($record->getExecutedAt())
|| (strtotime($record->getExecutedAt()) < $now - $historyLifetimes[$record->getStatus()])
) {
$record->delete();
}
}
Expand Down

0 comments on commit 90fefd7

Please sign in to comment.