From 8a9089ff55648fc82d0f5ecbcf70684868a39db2 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 24 Jan 2018 15:17:09 +0100 Subject: [PATCH] Allow custom HTML in HTML Emails Signed-off-by: Joas Schilling --- lib/private/Mail/EMailTemplate.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/private/Mail/EMailTemplate.php b/lib/private/Mail/EMailTemplate.php index 0535dabc13e4e..2026433dd3d7d 100644 --- a/lib/private/Mail/EMailTemplate.php +++ b/lib/private/Mail/EMailTemplate.php @@ -434,7 +434,7 @@ public function addBodyText($text, $plainText = '') { $this->ensureBodyIsOpened(); - $this->htmlBody .= vsprintf($this->bodyText, [htmlspecialchars($text)]); + $this->htmlBody .= vsprintf($this->bodyText, [$text]); if ($plainText !== false) { $this->plainBody .= $plainText . PHP_EOL . PHP_EOL; } @@ -462,9 +462,9 @@ public function addBodyListItem($text, $metaInfo = '', $icon = '', $plainText = $plainMetaInfo = $metaInfo; } - $htmlText = htmlspecialchars($text); + $htmlText = $text; if ($metaInfo) { - $htmlText = '' . htmlspecialchars($metaInfo) . '
' . $htmlText; + $htmlText = '' . $metaInfo . '
' . $htmlText; } if ($icon !== '') { $icon = '•'; @@ -533,7 +533,7 @@ public function addBodyButtonGroup($textLeft, $color = $this->themingDefaults->getColorPrimary(); $textColor = $this->themingDefaults->getTextColorPrimary(); - $this->htmlBody .= vsprintf($this->buttonGroup, [$color, $color, $urlLeft, $color, $textColor, $textColor, htmlspecialchars($textLeft), $urlRight, htmlspecialchars($textRight)]); + $this->htmlBody .= vsprintf($this->buttonGroup, [$color, $color, $urlLeft, $color, $textColor, $textColor, $textLeft, $urlRight, $textRight]); $this->plainBody .= $plainTextLeft . ': ' . $urlLeft . PHP_EOL; $this->plainBody .= $plainTextRight . ': ' . $urlRight . PHP_EOL . PHP_EOL; @@ -563,7 +563,7 @@ public function addBodyButton($text, $url, $plainText = '') { $color = $this->themingDefaults->getColorPrimary(); $textColor = $this->themingDefaults->getTextColorPrimary(); - $this->htmlBody .= vsprintf($this->button, [$color, $color, $url, $color, $textColor, $textColor, htmlspecialchars($text)]); + $this->htmlBody .= vsprintf($this->button, [$color, $color, $url, $color, $textColor, $textColor, $text]); if ($plainText !== false) { $this->plainBody .= $plainText . ': ';