MDL-13826 link/file resource - check maximum length ; merged from 19_STABLE

This commit is contained in:
stronk7
2009-05-07 20:41:33 +00:00
parent 3ea24f884a
commit 99e8a8a838
+2 -1
View File
@@ -789,8 +789,9 @@ class resource_file extends resource_base {
$this->set_parameters(); // set the parameter array for the form
$mform->addElement('choosecoursefile', 'reference', get_string('location'));
$mform->addElement('choosecoursefile', 'reference', get_string('location'), null, array('maxlength' => 255, 'size' => 48));
$mform->setDefault('reference', $CFG->resource_defaulturl);
$mform->addGroupRule('reference', array('value' => array(array(get_string('maximumchars', '', 255), 'maxlength', 255, 'client'))));
$mform->addRule('name', null, 'required', null, 'client');
if (!empty($CFG->resource_websearch)) {