diff --git a/CRM/Core/JobManager.php b/CRM/Core/JobManager.php index fccfc18b8cf..0583f9c2552 100644 --- a/CRM/Core/JobManager.php +++ b/CRM/Core/JobManager.php @@ -229,10 +229,21 @@ public function logEntry($message) { $dao = new CRM_Core_DAO_JobLog(); $dao->domain_id = $domainID; - $dao->description = substr($message, 0, 235); - if (strlen($message) > 235) { - $dao->description .= " (...)"; + + /* + * The description is a summary of the message. + * HTML tags are stripped from the message. + * The description is limited to 240 characters + * and has an ellipsis added if it is truncated. + */ + $maxDescription = 240; + $ellipsis = " (...)"; + $description = strip_tags($message); + if (strlen($description) > $maxDescription) { + $description = substr($description, 0, $maxDescription - strlen($ellipsis)) . $ellipsis; } + $dao->description = $description; + if ($this->currentJob) { $dao->job_id = $this->currentJob->id; $dao->name = $this->currentJob->name;