From 99e8a8a8380d061d51b7d531ee29fd6065196f67 Mon Sep 17 00:00:00 2001 From: stronk7 Date: Thu, 7 May 2009 20:41:33 +0000 Subject: [PATCH] MDL-13826 link/file resource - check maximum length ; merged from 19_STABLE --- mod/resource/type/file/resource.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mod/resource/type/file/resource.class.php b/mod/resource/type/file/resource.class.php index 30eb00554a..7c87efe4f4 100644 --- a/mod/resource/type/file/resource.class.php +++ b/mod/resource/type/file/resource.class.php @@ -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)) { -- 2.39.5