Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Job Log entries containing links so they will display properly #12659

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions CRM/Core/JobManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down