N°7845 Suppress risky syntax with DateTime::modify (at best, just a bad example, at worst, just a result that will vary wether PHP > 8.2 or not)

This commit is contained in:
Romain Quetiez
2024-09-26 17:51:52 +02:00
parent 8e2a68887c
commit 380512dcbe
6 changed files with 117 additions and 42 deletions

View File

@@ -168,7 +168,7 @@ function RunTask(BackgroundTask $oTask, $iTimeLimit)
// Background processes do repeat periodically
$oPlannedStart = clone $oDatePlanned;
// Let's schedule from the previous planned date of execution to avoid shift
$oPlannedStart->modify('+'.$oProcess->GetPeriodicity().' seconds');
$oPlannedStart->modify($oProcess->GetPeriodicity().' seconds');
$oEnd = new DateTime();
while ($oPlannedStart->format('U') < $oEnd->format('U'))
{