From: Tim Düsterhus Date: Sun, 31 Jul 2016 19:08:29 +0000 (+0200) Subject: Improve layout of text/plain emails X-Git-Tag: 3.0.0_Beta_1~832 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=06d7ef7d4e28923186467d58a3ef244499f85c67;p=GitHub%2FWoltLab%2FWCF.git Improve layout of text/plain emails --- diff --git a/wcfsetup/install/files/lib/system/email/mime/RecipientAwareTextMimePart.class.php b/wcfsetup/install/files/lib/system/email/mime/RecipientAwareTextMimePart.class.php index 806c86a3ef..fd395a5912 100644 --- a/wcfsetup/install/files/lib/system/email/mime/RecipientAwareTextMimePart.class.php +++ b/wcfsetup/install/files/lib/system/email/mime/RecipientAwareTextMimePart.class.php @@ -90,12 +90,12 @@ class RecipientAwareTextMimePart extends TextMimePart implements IRecipientAware return '['.$urls[$matches[1]].']'; }, $result); - $result = preg_replace_callback('/(\r?\n-- \r?\n|$)/', function ($matches) use ($urls) { - $list = ''; + $result = preg_replace_callback('/(?:\r?\n)*(\r?\n-- \r?\n|$)/', function ($matches) use ($urls) { + $list = "\r\n"; foreach ($urls as $url => $number) { $list .= "\r\n[".$number."] ".$url; } - return $list."\r\n".$matches[0]; + return $list."\r\n".$matches[1]; }, $result, 1); }