Permalink
Browse files

MDL-13826 link/file resource - check maximum length

  • Loading branch information...
1 parent 3be9556 commit 80fbfbb3f6bc6b9221c36cbb53462750ed23c1a1 stronk7 committed May 7, 2009
Showing with 2 additions and 1 deletion.
  1. +2 −1 mod/resource/type/file/resource.class.php
@@ -790,8 +790,9 @@ function setup_elements(&$mform) {
$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)) {

0 comments on commit 80fbfbb

Please sign in to comment.