$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");
}
// 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;
}
//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
}
$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>');