Browse Source

No newlines when heading is empty

Signed-off-by: Joas Schilling <coding@schilljs.com>
tags/v12.0.0beta1
Joas Schilling 7 years ago
parent
commit
4b639e2763
No account linked to committer's email address
2 changed files with 7 additions and 3 deletions
  1. 5
    2
      lib/private/Mail/EMailTemplate.php
  2. 2
    1
      lib/public/Mail/IEMailTemplate.php

+ 5
- 2
lib/private/Mail/EMailTemplate.php View File

@@ -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;
}
}

/**

+ 2
- 1
lib/public/Mail/IEMailTemplate.php View File

@@ -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
*/

Loading…
Cancel
Save