diff MoinMoin/Page.py @ 3410:81b8a5bb8711

send_page sucks. fix bug with invalid highlight REs
author Johannes Berg <johannes AT sipsolutions DOT net>
date Sat, 22 Mar 2008 13:43:21 +0100
parents 396d3434ab92
children ef612c82bdfd
line wrap: on
line diff
--- a/MoinMoin/Page.py	Sat Mar 22 13:25:06 2008 +0100
+++ b/MoinMoin/Page.py	Sat Mar 22 13:43:21 2008 +0100
@@ -1079,10 +1079,13 @@
             try:
                 self.formatter.set_highlight_re(self.hilite_re)
             except re.error, err:
+                if 'highlight' in request.form:
+                    del request.form['highlight']
                 request.theme.add_msg(_('Invalid highlighting regular expression "%(regex)s": %(error)s') % {
                                           'regex': self.hilite_re,
                                           'error': str(err),
                                       }, "warning")
+                self.hilite_re = None
 
         if 'deprecated' in pi:
             # deprecated page, append last backup version to current contents