comparison 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
comparison
equal deleted inserted replaced
3409:1c5bb02539cf 3410:81b8a5bb8711
1077 self.formatter.setPage(self) 1077 self.formatter.setPage(self)
1078 if self.hilite_re: 1078 if self.hilite_re:
1079 try: 1079 try:
1080 self.formatter.set_highlight_re(self.hilite_re) 1080 self.formatter.set_highlight_re(self.hilite_re)
1081 except re.error, err: 1081 except re.error, err:
1082 if 'highlight' in request.form:
1083 del request.form['highlight']
1082 request.theme.add_msg(_('Invalid highlighting regular expression "%(regex)s": %(error)s') % { 1084 request.theme.add_msg(_('Invalid highlighting regular expression "%(regex)s": %(error)s') % {
1083 'regex': self.hilite_re, 1085 'regex': self.hilite_re,
1084 'error': str(err), 1086 'error': str(err),
1085 }, "warning") 1087 }, "warning")
1088 self.hilite_re = None
1086 1089
1087 if 'deprecated' in pi: 1090 if 'deprecated' in pi:
1088 # deprecated page, append last backup version to current contents 1091 # deprecated page, append last backup version to current contents
1089 # (which should be a short reason why the page is deprecated) 1092 # (which should be a short reason why the page is deprecated)
1090 request.theme.add_msg(_('The backed up content of this page is deprecated and will not be included in search results!'), "warning") 1093 request.theme.add_msg(_('The backed up content of this page is deprecated and will not be included in search results!'), "warning")