N°4355/1745 Prevent malformed caselog entries from breaking activity panel DOM

This commit is contained in:
Stephen Abello
2021-11-09 16:18:25 +01:00
parent 60a17c9a65
commit 395c9c288b

View File

@@ -83,11 +83,12 @@ class ActivityEntryFactory
$oUser = MetaModel::GetObject('User', $aOrmEntry['user_id'], false, true);
$sUserLogin = ($oUser === null) ? '' : $oUser->Get('login');
// We sanitize OrmEntry even if it's already sanitized: if the entry is somehow truncated or metadata are wrong we may break whole page DOM
$oEntry = new CaseLogEntry(
DateTime::createFromFormat(AttributeDateTime::GetInternalFormat(), $aOrmEntry['date']),
$sUserLogin,
$sAttCode,
$aOrmEntry['message_html'],
\HTMLSanitizer::Sanitize($aOrmEntry['message_html']),
$aOrmEntry['user_login']
);