From 656e5fa476877cdf006997cb7f0af949e5af699f Mon Sep 17 00:00:00 2001 From: LogicDX342 <52480482+LogicDX342@users.noreply.github.com> Date: Thu, 21 Nov 2024 03:01:37 -0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E9=82=AE=E4=BB=B6?= =?UTF-8?q?=E9=80=9A=E7=9F=A5=E4=B8=AD=E7=89=B9=E6=AE=8A=E5=AD=97=E7=AC=A6?= =?UTF-8?q?=E7=9A=84=E5=A4=84=E7=90=86=E6=96=B9=E5=BC=8F=20(#11169)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: 修改邮件通知中特殊字符的处理方式 * refactor: use string.Empty instead of empty string literals Co-authored-by: status102 <102887808+status102@users.noreply.github.com> --------- Co-authored-by: status102 <102887808+status102@users.noreply.github.com> --- .../Services/Notification/SmtpNotificationProvider.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/MaaWpfGui/Services/Notification/SmtpNotificationProvider.cs b/src/MaaWpfGui/Services/Notification/SmtpNotificationProvider.cs index 8634a59076..7dff6578e8 100644 --- a/src/MaaWpfGui/Services/Notification/SmtpNotificationProvider.cs +++ b/src/MaaWpfGui/Services/Notification/SmtpNotificationProvider.cs @@ -59,8 +59,8 @@ namespace MaaWpfGui.Services.Notification var emailFrom = SettingsViewModel.ExternalNotificationSettings.SmtpFrom; var emailTo = SettingsViewModel.ExternalNotificationSettings.SmtpTo; - title = Regex.Replace(title, "\r(?!\n)", "\r\n"); - content = Regex.Replace(content, "\r(?!\n)", "\r\n"); + title = title.Replace("\r", string.Empty).Replace("\n", string.Empty); + content = content.Replace("\r", string.Empty).Replace("\n", string.Empty); var email = Email .From(emailFrom)