mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
MDL-15697 Added a check form rule limiting post subject and forum name to 255 characters, as limited by the DB
This commit is contained in:
parent
2040478fb2
commit
b230cac1da
2 changed files with 2 additions and 0 deletions
|
@ -14,6 +14,7 @@ class mod_forum_mod_form extends moodleform_mod {
|
||||||
$mform->addElement('text', 'name', get_string('forumname', 'forum'), array('size'=>'64'));
|
$mform->addElement('text', 'name', get_string('forumname', 'forum'), array('size'=>'64'));
|
||||||
$mform->setType('name', PARAM_TEXT);
|
$mform->setType('name', PARAM_TEXT);
|
||||||
$mform->addRule('name', null, 'required', null, 'client');
|
$mform->addRule('name', null, 'required', null, 'client');
|
||||||
|
$mform->addRule('name', get_string('maximumchars', '', 255), 'maxlength', 255, 'client');
|
||||||
|
|
||||||
$forum_types = forum_get_forum_types();
|
$forum_types = forum_get_forum_types();
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,7 @@ class mod_forum_post_form extends moodleform {
|
||||||
$mform->addElement('text', 'subject', get_string('subject', 'forum'), 'size="48"');
|
$mform->addElement('text', 'subject', get_string('subject', 'forum'), 'size="48"');
|
||||||
$mform->setType('subject', PARAM_TEXT);
|
$mform->setType('subject', PARAM_TEXT);
|
||||||
$mform->addRule('subject', get_string('required'), 'required', null, 'client');
|
$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->addElement('htmleditor', 'message', get_string('message', 'forum'), array('cols'=>50, 'rows'=>30));
|
||||||
$mform->setType('message', PARAM_RAW);
|
$mform->setType('message', PARAM_RAW);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue