Skip to content

Commit

Permalink
Merged MDL-13643 from 1.9
Browse files Browse the repository at this point in the history
  • Loading branch information
moodler committed Feb 25, 2008
1 parent 16803c5 commit 0d62649
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
20 changes: 19 additions & 1 deletion lib/moodlelib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Expand Down Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion tag/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@

//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
}
Expand Down
2 changes: 1 addition & 1 deletion tag/edit_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function definition () {

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

Expand Down

0 comments on commit 0d62649

Please sign in to comment.