From: Tim Düsterhus Date: Wed, 3 Aug 2016 16:39:27 +0000 (+0200) Subject: Change style of links in text/plain emails X-Git-Tag: 3.0.0_Beta_1~818 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=186f68280b7b67321add96bc4e9649bef1c2d518;p=GitHub%2FWoltLab%2FWCF.git Change style of links in 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 fd395a5912..f75e2e5c1a 100644 --- a/wcfsetup/install/files/lib/system/email/mime/RecipientAwareTextMimePart.class.php +++ b/wcfsetup/install/files/lib/system/email/mime/RecipientAwareTextMimePart.class.php @@ -81,22 +81,7 @@ class RecipientAwareTextMimePart extends TextMimePart implements IRecipientAware $result = $emogrifier->emogrify(); } else if ($this->mimeType === 'text/plain') { - $counter = 1; - $urls = []; - $result = preg_replace_callback('~\[URL:(https?://[^\]\s]*)\]~', function ($matches) use (&$counter, &$urls) { - if (!isset($urls[$matches[1]])) { - $urls[$matches[1]] = $counter++; - } - - return '['.$urls[$matches[1]].']'; - }, $result); - $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[1]; - }, $result, 1); + $result = preg_replace('~\[URL:(https?://[^\]\s]*)\]~', '<\\1>', $result); } return $result;