]> git.mjollnir.org Git - moodle.git/commitdiff
Merged MDL-13643 from 1.9
authormoodler <moodler>
Mon, 25 Feb 2008 07:17:04 +0000 (07:17 +0000)
committermoodler <moodler>
Mon, 25 Feb 2008 07:17:04 +0000 (07:17 +0000)
lib/moodlelib.php
tag/edit.php
tag/edit_form.php

index 239680e6ce817e9bf6962b758c392796cce59238..caf53402e8320098ed0e753d3d4047c688ff47f8 100644 (file)
@@ -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;
 }
 
index 06de0b80e20f7256ce1c9ecdf8701c16cd0424b0..92f1cf6cc3219af726ecb808a7c1764ebbd9a66b 100644 (file)
@@ -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
     }
index 43c657fbce2e2cc6e4ede8b2a5676bfe7a736580..4311b94a7e2bbfcb9a596cb71b96ab8f5be7a8a7 100644 (file)
@@ -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>');