summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2017-04-12 15:33:14 +0200
committerBjoern Schiessle <bjoern@schiessle.org>2017-04-12 17:16:27 +0200
commit4b639e276322b6294b8ac62d88de0985c0ab637a (patch)
treee383b9f1c73d9c40f5d427bc1a2205a3892ba91b
parent0a464dfb61a485a1340ecc9279e0db262154f059 (diff)
downloadnextcloud-server-4b639e276322b6294b8ac62d88de0985c0ab637a.tar.gz
nextcloud-server-4b639e276322b6294b8ac62d88de0985c0ab637a.zip
No newlines when heading is empty
Signed-off-by: Joas Schilling <coding@schilljs.com>
-rw-r--r--lib/private/Mail/EMailTemplate.php7
-rw-r--r--lib/public/Mail/IEMailTemplate.php3
2 files changed, 7 insertions, 3 deletions
diff --git a/lib/private/Mail/EMailTemplate.php b/lib/private/Mail/EMailTemplate.php
index b0378496d9e..805126d2ad8 100644
--- a/lib/private/Mail/EMailTemplate.php
+++ b/lib/private/Mail/EMailTemplate.php
@@ -335,7 +335,8 @@ EOF;
* Adds a heading to the email
*
* @param string $title
- * @param string $plainTitle Title that is used in the plain text email - if empty the $title is used
+ * @param string $plainTitle|bool Title that is used in the plain text email
+ * if empty the $title is used, if false none will be used
*/
public function addHeading($title, $plainTitle = '') {
if ($this->footerAdded) {
@@ -346,7 +347,9 @@ EOF;
}
$this->htmlBody .= vsprintf($this->heading, [htmlspecialchars($title)]);
- $this->plainBody .= $plainTitle . PHP_EOL . PHP_EOL;
+ if ($plainTitle !== false) {
+ $this->plainBody .= $plainTitle . PHP_EOL . PHP_EOL;
+ }
}
/**
diff --git a/lib/public/Mail/IEMailTemplate.php b/lib/public/Mail/IEMailTemplate.php
index 8e3233ee426..4e308509c42 100644
--- a/lib/public/Mail/IEMailTemplate.php
+++ b/lib/public/Mail/IEMailTemplate.php
@@ -62,7 +62,8 @@ interface IEMailTemplate {
* Adds a heading to the email
*
* @param string $title
- * @param string $plainTitle Title that is used in the plain text email - if empty the $title is used
+ * @param string $plainTitle|bool Title that is used in the plain text email
+ * if empty the $title is used, if false none will be used
*
* @since 12.0.0
*/