Skip to content

Commit

Permalink
pkp#10051 Fixed HTML entity code & in OJS email subject (pkp#10052)
Browse files Browse the repository at this point in the history
* pkp#10051 Fixed display & in email subjects to show correctly
* pkp#10051 Decode HTML entities in email subject during parameter replacement
  • Loading branch information
Hafsa-Naeem authored Jun 14, 2024
1 parent c57e61a commit e543199
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions classes/mail/MailTemplate.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ function send() {
}

/**
* Replace template variables in the message body.
* Replace template variables in the message body and subject.
* @param $params array Parameters to assign (augments anything provided via setParams)
*/
function replaceParams() {
Expand All @@ -231,9 +231,11 @@ function replaceParams() {
$body = str_replace('{$' . $key . '}', $value, $body);
}
}

$subject = str_replace('{$' . $key . '}', $value, $subject);
}

// Decode HTML entities for the subject after all replacements
$subject = htmlspecialchars_decode($subject, ENT_QUOTES | ENT_HTML5);
$this->setSubject($subject);
$this->setBody($body);
}
Expand Down

0 comments on commit e543199

Please sign in to comment.