Skip to content

Commit 45950c9

Browse files
committed
[BUGFIX] Remove extbase debugger markup in MailFactory.php
There is the rare chance that some extbase debugger code is saved in the database in the body field of mails. Switching to another function solves the issue. Related in2code-pro/powermail#3 Related #897 Fixes #920
1 parent 4fc5e40 commit 45950c9

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

Classes/Domain/Factory/MailFactory.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
use In2code\Powermail\Utility\SessionUtility;
1212
use TYPO3\CMS\Core\Configuration\Exception\ExtensionConfigurationExtensionNotConfiguredException;
1313
use TYPO3\CMS\Core\Configuration\Exception\ExtensionConfigurationPathDoesNotExistException;
14-
use TYPO3\CMS\Core\Utility\DebugUtility;
14+
use TYPO3\CMS\Core\Utility\ArrayUtility;
1515
use TYPO3\CMS\Core\Utility\GeneralUtility;
1616
use TYPO3\CMS\Extbase\Object\Exception;
1717
use TYPO3\CMS\Extbase\SignalSlot\Exception\InvalidSlotException;
@@ -42,7 +42,7 @@ public function prepareMailForPersistence(Mail $mail, array $settings): void
4242
->setSenderName($mailRepository->getSenderNameFromArguments($mail))
4343
->setSubject($settings['receiver']['subject'])
4444
->setReceiverMail($settings['receiver']['email'])
45-
->setBody(DebugUtility::viewArray($mailRepository->getVariablesWithMarkersFromMail($mail)))
45+
->setBody(ArrayUtility::arrayExport($mailRepository->getVariablesWithMarkersFromMail($mail)))
4646
->setSpamFactor(SessionUtility::getSpamFactorFromSession())
4747
->setTime((time() - SessionUtility::getFormStartFromSession($mail->getForm()->getUid(), $settings)))
4848
->setUserAgent(GeneralUtility::getIndpEnv('HTTP_USER_AGENT'))

Classes/Utility/ArrayUtility.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ public static function arrayMergeRecursiveOverrule(
148148
$firstArray[$key] = $value;
149149
}
150150
}
151-
// @codeCoverageIgnoreEnd
151+
// @codeCoverageIgnoreEnd
152152
} else {
153153
if ($emptyValuesOverride || !empty($value)) {
154154
$firstArray[$key] = $value;

Classes/Utility/StringUtility.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public static function isNotEmpty($value): bool
2727
if (isset($value) && strlen((string)$value)) {
2828
return true;
2929
}
30-
// array (checkboxes)
30+
// array (checkboxes)
3131
} else {
3232
foreach ($value as $subValue) {
3333
if (isset($value) && strlen((string)$subValue)) {

0 commit comments

Comments
 (0)