From 186f68280b7b67321add96bc4e9649bef1c2d518 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Wed, 3 Aug 2016 18:39:27 +0200 Subject: [PATCH] Change style of links in text/plain emails --- .../mime/RecipientAwareTextMimePart.class.php | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) 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; -- 2.20.1