mirror of
https://github.com/moodle/moodle.git
synced 2025-03-14 20:50:21 +01:00
Merge branch 'MDL-46705-master' of git://github.com/dkns/moodle
This commit is contained in:
commit
b3ec8cf95e
@ -4001,10 +4001,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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user