Skip to content

Commit 90fefd7

Browse files
fballianokiatng
andauthored
Fixed PHP8.2 deprecated warning in Mage_Cron_Model_Observer (#3253)
Co-authored-by: Ng Kiat Siong <kiatsiong.ng@gmail.com>
1 parent 68cb9ec commit 90fefd7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

app/code/core/Mage/Cron/Model/Observer.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,9 @@ public function cleanup()
220220

221221
$now = time();
222222
foreach ($history->getIterator() as $record) {
223-
if (strtotime($record->getExecutedAt()) < $now - $historyLifetimes[$record->getStatus()]) {
223+
if (empty($record->getExecutedAt())
224+
|| (strtotime($record->getExecutedAt()) < $now - $historyLifetimes[$record->getStatus()])
225+
) {
224226
$record->delete();
225227
}
226228
}

0 commit comments

Comments
 (0)