Ticket #6609: EMAIL_LOOKALIKE_PATTERN-r6658.diff
| File EMAIL_LOOKALIKE_PATTERN-r6658.diff, 2.0 KB (added by cboos, 4 years ago) |
|---|
-
trac/wiki/parser.py
21 21 import re 22 22 23 23 from trac.core import * 24 from trac.notification import EMAIL_LOOKALIKE_PATTERN 24 25 25 26 class WikiParser(Component): 26 27 """wiki subsystem dedicated to the Wiki text parsing.""" … … 73 74 74 75 _post_rules = [ 75 76 # e-mails 76 r"(?P<email> \w[\w.]+@\w[\w.]+\w)",77 r"(?P<email>%s)" % EMAIL_LOOKALIKE_PATTERN, 77 78 # > ... 78 79 r"(?P<citation>^(?P<cdepth>>(?: *>)*))", 79 80 # &, < and > to &, < and > -
trac/notification.py
24 24 from trac.core import * 25 25 from trac.util.text import CRLF 26 26 from trac.util.translation import _ 27 from trac.web.chrome import Chrome28 27 29 28 MAXHEADERLEN = 76 29 EMAIL_LOOKALIKE_PATTERN = (r"[a-zA-Z0-9.'=+-]+" '@' 30 '(?:[a-zA-Z0-9-]+\.)+[a-zA-Z]{2,4}') 30 31 31 32 32 class NotificationSystem(Component): 33 33 34 34 smtp_enabled = BoolOption('notification', 'smtp_enabled', 'false', … … 117 117 self.config = env.config 118 118 self.db = env.get_db_cnx() 119 119 120 from trac.web.chrome import Chrome 120 121 self.template = Chrome(self.env).load_template(self.template_name, 121 122 method='text') 122 123 # FIXME: actually, we would need a Context with a different … … 166 167 addrsep_re = re.compile(r'[;\s,]+') 167 168 168 169 def __init__(self, env): 170 global EMAIL_LOOKALIKE_PATTERN 169 171 Notify.__init__(self, env) 170 172 171 addrfmt = r'[\w\d_\.\-\+=]+\@(?:(?:[\w\d\-])+\.)+(?:[\w\d]{2,4})'173 addrfmt = EMAIL_LOOKALIKE_PATTERN 172 174 admit_domains = self.env.config.get('notification', 'admit_domains') 173 175 if admit_domains: 174 176 pos = addrfmt.find('@')
