Permalink
Browse files

MDL-15697 Added a check form rule limiting post subject and forum nam…

…e to 255 characters, as limited by the DB
  • Loading branch information...
1 parent 6c831d7 commit 5fa8b35428ffe70dded74c23f255673c49dfe0e1 ericmerrill committed Jul 18, 2008
Showing with 2 additions and 0 deletions.
  1. +1 −0 mod/forum/mod_form.php
  2. +1 −0 mod/forum/post_form.php
View
@@ -14,6 +14,7 @@ function definition() {
$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');
asort($FORUM_TYPES);
$mform->addElement('select', 'type', get_string('forumtype', 'forum'), $FORUM_TYPES);
View
@@ -24,6 +24,7 @@ function definition() {
$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);

0 comments on commit 5fa8b35

Please sign in to comment.