N°5216 Fix invalid message-id when sending notification using cron on system with a specific locale set (#297)

The timestamp used was indeed locale dependent.
This commit fixes this behavior by removing the locale dependency using a better printf format (see https://www.php.net/manual/fr/function.sprintf.php)
This commit is contained in:
Pierre Goiffon
2022-08-17 14:11:32 +02:00
committed by GitHub
parent 33c2168af2
commit 6b32be0899

View File

@@ -328,8 +328,12 @@ class ActionEmail extends ActionNotification
$sBody = MetaModel::ApplyParams($this->Get('body'), $aContextArgs);
$oObj = $aContextArgs['this->object()'];
$sMessageId = sprintf('iTop_%s_%d_%f@%s.openitop.org', get_class($oObj), $oObj->GetKey(), microtime(true /* get as float*/),
MetaModel::GetEnvironmentId());
$sMessageId = sprintf('iTop_%s_%d_%F@%s.openitop.org',
get_class($oObj),
$oObj->GetKey(),
microtime(true /* get as float*/),
MetaModel::GetEnvironmentId()
);
$sReference = '<'.$sMessageId.'>';
}
catch (Exception $e) {