diff options
| author | bwarsaw | 2002-04-18 22:24:52 +0000 |
|---|---|---|
| committer | bwarsaw | 2002-04-18 22:24:52 +0000 |
| commit | bead45b1350d8cecc8d05d6dca0dfdd45c65b2d1 (patch) | |
| tree | 44c82edf9c213f762799495c7165317ead4e2c29 | |
| parent | ac375419d112324be159706ac8200df36152508d (diff) | |
| download | mailman-bead45b1350d8cecc8d05d6dca0dfdd45c65b2d1.tar.gz mailman-bead45b1350d8cecc8d05d6dca0dfdd45c65b2d1.tar.zst mailman-bead45b1350d8cecc8d05d6dca0dfdd45c65b2d1.zip | |
| -rw-r--r-- | Mailman/Gui/Topics.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Mailman/Gui/Topics.py b/Mailman/Gui/Topics.py index 93de25701..b60e38548 100644 --- a/Mailman/Gui/Topics.py +++ b/Mailman/Gui/Topics.py @@ -14,6 +14,8 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +import re + from Mailman import mm_cfg from Mailman.i18n import _ from Mailman.Logging.Syslog import syslog @@ -115,6 +117,15 @@ class Topics(GUIBase): a pattern. Incomplete topics will be ignored.""")) continue + # Make sure the pattern was a legal regular expression + try: + syslog('error', 'pattern: %s', pattern) + re.compile(pattern) + except (re.error, TypeError): + doc.addError(_("""The topic pattern `%(pattern)s' is not a + legal regular expression. It will be discarded.""")) + continue + # Was this an add item? if cgidata.has_key(addtag): # Where should the new one be added? |
