소스 검색

fix: replace cr and lf characters with empty string in case of exception

(cherry picked from commit 6310494aa9)
version-14
prssanna 4 년 전
committed by mergify-bot
부모
커밋
be36c532b7
1개의 변경된 파일8개의 추가작업 그리고 2개의 파일을 삭제
  1. +8
    -2
      frappe/email/email_body.py

+ 8
- 2
frappe/email/email_body.py 파일 보기

@@ -207,7 +207,7 @@ class EMail:

def set_in_reply_to(self, in_reply_to):
"""Used to send the Message-Id of a received email back as In-Reply-To"""
self.msg_root["In-Reply-To"] = in_reply_to.replace("\r", "").replace("\n", "")
self.set_header('In-Reply-To', in_reply_to)

def make(self):
"""build into msg_root"""
@@ -234,7 +234,10 @@ class EMail:
if key in self.msg_root:
del self.msg_root[key]

self.msg_root[key] = value
try:
self.msg_root[key] = value
except ValueError:
self.msg_root[key] = sanitize_email_header(value)

def as_string(self):
"""validate, build message and convert to string"""
@@ -458,3 +461,6 @@ def get_header(header=None):
})

return email_header

def sanitize_email_header(str):
return str.replace('\r', '').replace('\n', '')

불러오는 중...
취소
저장