Commit 57caaace authored by David Monllaó's avatar David Monllaó
Browse files

Merge branch 'MDL-46705-28' of git://github.com/dkns/moodle into MOODLE_28_STABLE

parents 42ba6f01 5d9bc0ac
......@@ -3969,10 +3969,14 @@ class admin_setting_sitesettext extends admin_setting_configtext {
* @return mixed true or message string
*/
public function validate($data) {
global $DB;
$cleaned = clean_param($data, PARAM_TEXT);
if ($cleaned === '') {
return get_string('required');
}
if ($this->name ==='shortname' && $DB->record_exists('course', array('shortname' => $data))) {
return get_string('shortnametaken', 'error', $data);
}
if ("$data" == "$cleaned") { // implicit conversion to string is needed to do exact comparison
return true;
} else {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment