diff --git a/trac/ticket/web_ui.py b/trac/ticket/web_ui.py
|
a
|
b
|
|
| 106 | 106 | max_description_size = IntOption('ticket', 'max_description_size', 262144, |
| 107 | 107 | """Don't accept tickets with a too big description. |
| 108 | 108 | (''since 0.11'').""") |
| | 109 | |
| | 110 | max_comment_size = IntOption('ticket', 'max_comment_size', 262144, |
| | 111 | """Don't accept tickets with a too big comment. |
| | 112 | (''since 0.11'')""") |
| 109 | 113 | |
| 110 | 114 | timeline_newticket_formatter = Option('timeline', 'newticket_formatter', |
| 111 | 115 | 'oneliner', |
| … |
… |
|
| 928 | 932 | num=self.max_description_size)) |
| 929 | 933 | valid = False |
| 930 | 934 | |
| | 935 | # Validate comment length |
| | 936 | if len(comment or '') > self.max_comment_size: |
| | 937 | add_warning(req, _('Ticket comment is too long (must be less ' |
| | 938 | 'than %(num)s characters)', |
| | 939 | num=self.max_comment_size)) |
| | 940 | valid = False |
| | 941 | |
| 931 | 942 | # Validate comment numbering |
| 932 | 943 | try: |
| 933 | 944 | # comment index must be a number |
diff --git a/trac/wiki/web_ui.py b/trac/wiki/web_ui.py
|
a
|
b
|
|
| 24 | 24 | from genshi.builder import tag |
| 25 | 25 | |
| 26 | 26 | from trac.attachment import AttachmentModule |
| | 27 | from trac.config import IntOption |
| 27 | 28 | from trac.core import * |
| 28 | 29 | from trac.mimeview.api import Mimeview, IContentConverter, Context |
| 29 | 30 | from trac.perm import IPermissionRequestor |
| … |
… |
|
| 57 | 58 | ITemplateProvider) |
| 58 | 59 | |
| 59 | 60 | page_manipulators = ExtensionPoint(IWikiPageManipulator) |
| | 61 | |
| | 62 | max_size = IntOption('wiki', 'max_size', 262144, |
| | 63 | """Maximum allowed wiki page size in bytes. (''since 0.11'')""") |
| 60 | 64 | |
| 61 | 65 | PAGE_TEMPLATES_PREFIX = 'PageTemplates/' |
| 62 | 66 | DEFAULT_PAGE_TEMPLATE = 'DefaultPage' |
| … |
… |
|
| 173 | 177 | |
| 174 | 178 | def _validate(self, req, page): |
| 175 | 179 | valid = True |
| | 180 | |
| | 181 | # Validate page size |
| | 182 | if len(req.args.get('text', '')) > self.max_size: |
| | 183 | add_warning(req, _('The wiki page is too long (must be less ' |
| | 184 | 'than %(num)s characters)', |
| | 185 | num=self.max_size)) |
| | 186 | valid = False |
| | 187 | |
| 176 | 188 | # Give the manipulators a pass at post-processing the page |
| 177 | 189 | for manipulator in self.page_manipulators: |
| 178 | 190 | for field, message in manipulator.validate_wiki_page(req, page): |