mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 16:32:18 +02:00
Merged MDL-13643 from 1.9
This commit is contained in:
parent
16803c57e9
commit
0d626493f3
@ -566,6 +566,22 @@ function clean_param($param, $type) {
|
||||
$param = $textlib->substr(trim($param), 0, TAG_MAX_LENGTH);
|
||||
return $param;
|
||||
|
||||
|
||||
case PARAM_TAGLIST:
|
||||
$tags = explode(',', $param);
|
||||
$result = array();
|
||||
foreach ($tags as $tag) {
|
||||
$res = clean_param($tag, PARAM_TAG);
|
||||
if ($res != '') {
|
||||
$result[] = $res;
|
||||
}
|
||||
}
|
||||
if ($result) {
|
||||
return implode(',', $result);
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
|
||||
default: // throw error, switched parameters in optional_param or another serious problem
|
||||
error("Unknown parameter type: $type");
|
||||
}
|
||||
@ -3040,7 +3056,9 @@ function authenticate_user_login($username, $password) {
|
||||
|
||||
// failed if all the plugins have failed
|
||||
add_to_log(0, 'login', 'error', 'index.php', $username);
|
||||
error_log('[client '.$_SERVER['REMOTE_ADDR']."] $CFG->wwwroot Failed Login: $username ".$_SERVER['HTTP_USER_AGENT']);
|
||||
if (debugging('', DEBUG_ALL)) {
|
||||
error_log('[client '.$_SERVER['REMOTE_ADDR']."] $CFG->wwwroot Failed Login: $username ".$_SERVER['HTTP_USER_AGENT']);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -77,7 +77,7 @@ if ($tagnew = $tagform->get_data()) {
|
||||
|
||||
//updated related tags
|
||||
tag_set('tag', $tagnew->id, explode(',', trim($tagnew->relatedtags)));
|
||||
//var_dump($tagnew); die();
|
||||
//print_object($tagnew); die();
|
||||
|
||||
redirect($CFG->wwwroot.'/tag/index.php?tag='.rawurlencode($tag->name)); // must use $tag here, as the name isn't in the edit form
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ class tag_edit_form extends moodleform {
|
||||
|
||||
$mform->addElement('html', '<br/><div id="relatedtags-autocomplete-container">');
|
||||
$mform->addElement('textarea', 'relatedtags', get_string('relatedtags','tag'), 'cols="50" rows="3"');
|
||||
$mform->setType('relatedtags', PARAM_TAG);
|
||||
$mform->setType('relatedtags', PARAM_TAGLIST);
|
||||
$mform->addElement('html', '</div>');
|
||||
$mform->addElement('html', '<div id="relatedtags-autocomplete"></div>');
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user