From 9dd373cb7bc6b2fcb6258d7b5b0db7728bb96730 Mon Sep 17 00:00:00 2001 From: Hannes Papenberg Date: Fri, 8 Sep 2023 14:52:05 +0200 Subject: [PATCH 1/3] MailTemplate: Prevent notice in replaceTags --- libraries/src/Mail/MailTemplate.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libraries/src/Mail/MailTemplate.php b/libraries/src/Mail/MailTemplate.php index 42785c5dcab06..91b7a79a8f757 100644 --- a/libraries/src/Mail/MailTemplate.php +++ b/libraries/src/Mail/MailTemplate.php @@ -325,6 +325,11 @@ public function send() protected function replaceTags($text, $tags) { foreach ($tags as $key => $value) { + // If the value is NULL, we want to replace with an empty string. NULL itself throws notices + if (is_null($value)) { + $value = ''; + } + if (is_array($value)) { $matches = []; $pregKey = preg_quote(strtoupper($key), '/'); From a32b9931478d4830a3328c509b828ac1cd5b1786 Mon Sep 17 00:00:00 2001 From: Hannes Papenberg Date: Thu, 14 Sep 2023 11:27:33 +0200 Subject: [PATCH 2/3] Update libraries/src/Mail/MailTemplate.php Co-authored-by: Quy --- libraries/src/Mail/MailTemplate.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/src/Mail/MailTemplate.php b/libraries/src/Mail/MailTemplate.php index 91b7a79a8f757..9575c7b35b6c9 100644 --- a/libraries/src/Mail/MailTemplate.php +++ b/libraries/src/Mail/MailTemplate.php @@ -325,7 +325,7 @@ public function send() protected function replaceTags($text, $tags) { foreach ($tags as $key => $value) { - // If the value is NULL, we want to replace with an empty string. NULL itself throws notices + // If the value is NULL, replace with an empty string. NULL itself throws notices if (is_null($value)) { $value = ''; } From 3141e13b0677b4aea32ec031ddb958c6b7386a3d Mon Sep 17 00:00:00 2001 From: Hannes Papenberg Date: Tue, 10 Oct 2023 10:31:04 +0200 Subject: [PATCH 3/3] Update MailTemplate.php --- libraries/src/Mail/MailTemplate.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/src/Mail/MailTemplate.php b/libraries/src/Mail/MailTemplate.php index 1e1f2104e223f..b74c2b67d17f5 100644 --- a/libraries/src/Mail/MailTemplate.php +++ b/libraries/src/Mail/MailTemplate.php @@ -326,7 +326,7 @@ 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)) { + if (\is_null($value)) { $value = ''; }