Skip to content

Commit

Permalink
[5.0] MailTemplate: Prevent notice in replaceTags (joomla#41679)
Browse files Browse the repository at this point in the history
* MailTemplate: Prevent notice in replaceTags

* Update libraries/src/Mail/MailTemplate.php

Co-authored-by: Quy <[email protected]>

* Update MailTemplate.php

---------

Co-authored-by: Quy <[email protected]>
  • Loading branch information
Hackwar and Quy authored Oct 17, 2023
1 parent 2e2d920 commit 291b995
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions libraries/src/Mail/MailTemplate.php
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,11 @@ public function send()
protected function replaceTags($text, $tags)
{
foreach ($tags as $key => $value) {
// If the value is NULL, replace with an empty string. NULL itself throws notices
if (\is_null($value)) {
$value = '';
}

if (\is_array($value)) {
$matches = [];
$pregKey = preg_quote(strtoupper($key), '/');
Expand Down

0 comments on commit 291b995

Please sign in to comment.