From 509a60ab21bb8dfc70bca0796e7cb8c5565050dc Mon Sep 17 00:00:00 2001 From: Michael Stein Date: Thu, 23 Oct 2025 12:12:34 +0200 Subject: [PATCH 1/3] [BUGFIX] prevent undefined key access --- Classes/Plugin/DirectMail.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Classes/Plugin/DirectMail.php b/Classes/Plugin/DirectMail.php index 8a2595903..c3d9c6d3f 100644 --- a/Classes/Plugin/DirectMail.php +++ b/Classes/Plugin/DirectMail.php @@ -741,11 +741,11 @@ public function renderImages(array $imagesArray, string $fieldname): string // create the image, imagelink and image caption block foreach ($imagesArray as $k => $image) { - if (strlen(trim($image['image'])) > 0) { + if (array_key_exists('image', $image) && strlen(trim($image['image'])) > 0) { $lines[] = $image['image']; if ($image['link']) { $theLink = $this->getLink($image['link']); - if ($theLink) { + if (array_key_exists($fieldname . '.', $this->conf) && $theLink) { $lines[] = $this->getString($this->conf[$fieldname . '.']['linkPrefix']) . $theLink; } } @@ -758,7 +758,7 @@ public function renderImages(array $imagesArray, string $fieldname): string $imageExists = true; } } - if ($this->conf[$fieldname . '.']['header'] && $imageExists) { + if (array_key_exists($fieldname . '.', $this->conf) && $this->conf[$fieldname . '.']['header'] && $imageExists) { array_unshift($lines, $this->getString($this->conf[$fieldname . '.']['header'])); } @@ -825,7 +825,7 @@ public function getString(string $str): string */ public function userProcess(string $mConfKey, $passVar) { - if ($this->conf[$mConfKey]) { + if ($this->conf[$mConfKey] ?? false) { $funcConf = $this->conf[$mConfKey . '.']; $funcConf['parentObj']=&$this; $passVar = $GLOBALS['TSFE']->cObj->callUserFunction( From b4910d60bae52bbaa2d0297f847a02a9519e3ea9 Mon Sep 17 00:00:00 2001 From: Michael Stein Date: Thu, 23 Oct 2025 13:11:25 +0200 Subject: [PATCH 2/3] [BUGFIX] prevent undefined key access --- Classes/Module/DmailController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/Module/DmailController.php b/Classes/Module/DmailController.php index a634b7aa1..311f3c0e9 100644 --- a/Classes/Module/DmailController.php +++ b/Classes/Module/DmailController.php @@ -1219,7 +1219,7 @@ protected function sendMail($row) } elseif ($this->cmd == DmailCmdEnum::SendMailTest->value) { // step 4, sending test personalized test emails // setting Testmail flag - $htmlmail->setTestmail((bool)$this->params['testmail']); + $htmlmail->setTestmail((bool)($this->params['testmail'] ?? false)); if ($this->tt_address_uid) { // personalized to tt_address From 87539d178c02be9141825481127bfb90acac68b1 Mon Sep 17 00:00:00 2001 From: Michael Stein Date: Fri, 24 Oct 2025 13:44:15 +0200 Subject: [PATCH 3/3] [BUGFIX] prevent undefined functioncall on missing translations --- Classes/SelectCategories.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/SelectCategories.php b/Classes/SelectCategories.php index c24af3f3c..b86c07659 100644 --- a/Classes/SelectCategories.php +++ b/Classes/SelectCategories.php @@ -39,7 +39,7 @@ public function getLocalizedCategories(array &$params): void $lang = $this->getLang(); $site = $params['site']; - $languages = $site->getAllLanguages(); + $languages = $site->getAllLanguages() ?? []; foreach($languages as $language) { if($language->getLocale()->getLanguageCode() == $lang) { $sysLanguageUid = $language->getLanguageId();