@@ -278,9 +278,9 @@ def __init__(self, message=None, sequence=0, keepHeaders=[],
278278 i18n .set_language (lang )
279279 if self .author == self .email :
280280 self .author = self .email = re .sub ('@' , _ (' at ' ),
281- self .email )
281+ self .email , flags = re . IGNORECASE )
282282 else :
283- self .email = re .sub ('@' , _ (' at ' ), self .email )
283+ self .email = re .sub ('@' , _ (' at ' ), self .email , flags = re . IGNORECASE )
284284 finally :
285285 i18n .set_translation (otrans )
286286
@@ -413,7 +413,7 @@ def decode_headers(self):
413413 i18n .set_language (self ._lang )
414414 atmark = str (_ (' at ' ), Utils .GetCharSet (self ._lang ))
415415 subject = re .sub (r'([-+,.\w]+)@([-+.\w]+)' ,
416- r'\g<1>' + atmark + r'\g<2>' , subject )
416+ r'\g<1>' + atmark + r'\g<2>' , subject , flags = re . IGNORECASE )
417417 finally :
418418 i18n .set_translation (otrans )
419419 self .decoded ['subject' ] = subject
@@ -426,14 +426,14 @@ def strip_subject(self, subject):
426426 if prefix :
427427 prefix_pat = re .escape (prefix )
428428 prefix_pat = '%' .join (prefix_pat .split (r'\%' ))
429- prefix_pat = re .sub (r'%\d*d' , r'\s*\d+\s*' , prefix_pat )
430- subject = re .sub (prefix_pat , '' , subject )
429+ prefix_pat = re .sub (r'%\d*d' , r'\s*\d+\s*' , prefix_pat , flags = re . IGNORECASE )
430+ subject = re .sub (prefix_pat , '' , subject , flags = re . IGNORECASE )
431431 subject = subject .lstrip ()
432432 # MAS Should we strip FW and FWD too?
433433 strip_pat = re .compile (r'^((RE|AW|SV|VS)(\[\d+\])?:\s*)+' , re .I )
434434 stripped = strip_pat .sub ('' , subject )
435435 # Also remove whitespace to avoid folding/unfolding differences
436- stripped = re .sub (r'\s' , '' , stripped )
436+ stripped = re .sub (r'\s' , '' , stripped , flags = re . IGNORECASE )
437437 return stripped
438438
439439 def decode_charset (self , field ):
@@ -469,7 +469,7 @@ def as_html(self):
469469 d ["in_reply_to_url" ] = url_quote (self ._message_id )
470470 if mm_cfg .ARCHIVER_OBSCURES_EMAILADDRS :
471471 # Point the mailto url back to the list
472- author = re .sub ('@' , _ (' at ' ), self .author )
472+ author = re .sub ('@' , _ (' at ' ), self .author , flags = re . IGNORECASE )
473473 emailurl = self ._mlist .GetListEmail ()
474474 else :
475475 author = self .author
@@ -580,7 +580,7 @@ def as_text(self):
580580 i18n .set_language (self ._lang )
581581 atmark = str (_ (' at ' ), cset )
582582 body = re .sub (r'([-+,.\w]+)@([-+.\w]+)' ,
583- r'\g<1>' + atmark + r'\g<2>' , body )
583+ r'\g<1>' + atmark + r'\g<2>' , body , flags = re . IGNORECASE )
584584 finally :
585585 i18n .set_translation (otrans )
586586 # Return body to character set of article.
@@ -916,7 +916,7 @@ def volNameToDesc(self, volname):
916916 _ ('September' ), _ ('October' ), _ ('November' ), _ ('December' )
917917 ]
918918 for each in list (self ._volre .keys ()):
919- match = re .match (self ._volre [each ], volname )
919+ match = re .match (self ._volre [each ], volname , re . IGNORECASE )
920920 # Let ValueErrors percolate up
921921 if match :
922922 year = int (match .group ('year' ))
@@ -976,7 +976,7 @@ def dateToVolName(self,date):
976976 def volNameToDate (self , volname ):
977977 volname = volname .strip ()
978978 for each in list (self ._volre .keys ()):
979- match = re .match (self ._volre [each ],volname )
979+ match = re .match (self ._volre [each ],volname , re . IGNORECASE )
980980 if match :
981981 year = int (match .group ('year' ))
982982 month = 1
@@ -1052,7 +1052,7 @@ def write_index_entry(self, article):
10521052 author = self .get_header ("author" , article )
10531053 if mm_cfg .ARCHIVER_OBSCURES_EMAILADDRS :
10541054 try :
1055- author = re .sub ('@' , _ (' at ' ), author )
1055+ author = re .sub ('@' , _ (' at ' ), author , flags = re . IGNORECASE )
10561056 except UnicodeError :
10571057 # Non-ASCII author contains '@' ... no valid email anyway
10581058 pass
@@ -1224,7 +1224,7 @@ def __processbody_URLquote(self, lines):
12241224 text = jr .group (1 )
12251225 length = len (text )
12261226 if mm_cfg .ARCHIVER_OBSCURES_EMAILADDRS :
1227- text = re .sub ('@' , atmark , text )
1227+ text = re .sub ('@' , atmark , text , flags = re . IGNORECASE )
12281228 URL = self .maillist .GetScriptURL (
12291229 'listinfo' , absolute = 1 )
12301230 else :
0 commit comments