X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FObject%2FEmail.php;h=fdde4e96ddd751a329f4e16e434acdaddd79607f;hb=c2c563be26697169f734f2654ab491a4e8ffff2f;hp=9f78763127c288704e156cd527b7196961568a33;hpb=c6b45a958e3b09bc8f3950a718c181dfc9e0b910;p=friendica.git diff --git a/src/Object/Email.php b/src/Object/Email.php index 9f78763127..fdde4e96dd 100644 --- a/src/Object/Email.php +++ b/src/Object/Email.php @@ -1,6 +1,6 @@ msgText; } else { - return $this->msgHtml; + return $this->msgHtml ?? ''; } } @@ -135,14 +135,15 @@ class Email implements IEmail $headerString = ''; foreach ($this->additionalMailHeader as $name => $values) { - if (is_array($values)) { - foreach ($values as $value) { - $headerString .= $name . ': ' . $value . '\n'; - } - } else { - $headerString .= $name . ': ' . $values . '\n'; + if (!is_array($values)) { + $values = [$values]; + } + + foreach ($values as $value) { + $headerString .= "$name: $value\r\n"; } } + return $headerString; } @@ -199,6 +200,7 @@ class Email implements IEmail /** * @inheritDoc */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return $this->toArray();