From b230cac1da5a565f538171553157fbb11b4c9fc5 Mon Sep 17 00:00:00 2001 From: ericmerrill Date: Fri, 18 Jul 2008 13:19:55 +0000 Subject: [PATCH] MDL-15697 Added a check form rule limiting post subject and forum name to 255 characters, as limited by the DB --- mod/forum/mod_form.php | 1 + mod/forum/post_form.php | 1 + 2 files changed, 2 insertions(+) diff --git a/mod/forum/mod_form.php b/mod/forum/mod_form.php index 1b615b7439..1bb172e369 100644 --- a/mod/forum/mod_form.php +++ b/mod/forum/mod_form.php @@ -14,6 +14,7 @@ class mod_forum_mod_form extends moodleform_mod { $mform->addElement('text', 'name', get_string('forumname', 'forum'), array('size'=>'64')); $mform->setType('name', PARAM_TEXT); $mform->addRule('name', null, 'required', null, 'client'); + $mform->addRule('name', get_string('maximumchars', '', 255), 'maxlength', 255, 'client'); $forum_types = forum_get_forum_types(); diff --git a/mod/forum/post_form.php b/mod/forum/post_form.php index ee5a23fbcf..02b3cc5396 100644 --- a/mod/forum/post_form.php +++ b/mod/forum/post_form.php @@ -25,6 +25,7 @@ class mod_forum_post_form extends moodleform { $mform->addElement('text', 'subject', get_string('subject', 'forum'), 'size="48"'); $mform->setType('subject', PARAM_TEXT); $mform->addRule('subject', get_string('required'), 'required', null, 'client'); + $mform->addRule('subject', get_string('maximumchars', '', 255), 'maxlength', 255, 'client'); $mform->addElement('htmleditor', 'message', get_string('message', 'forum'), array('cols'=>50, 'rows'=>30)); $mform->setType('message', PARAM_RAW); -- 2.39.5