]> git.mjollnir.org Git - moodle.git/commitdiff
nothing much here either
authortoyomoyo <toyomoyo>
Fri, 21 Apr 2006 02:47:01 +0000 (02:47 +0000)
committertoyomoyo <toyomoyo>
Fri, 21 Apr 2006 02:47:01 +0000 (02:47 +0000)
blog/edit.php

index 5e8ef8f9be5b1b60f33b5be6d2eb6786f2239b30..8878f46ae9220ecddd909753dfa7d4b3726da5db 100755 (executable)
@@ -226,23 +226,25 @@ function do_save($post) {
             update_record('post', $dataobject);
 
             /// Associate tags with entries
-            $otags = optional_param('otags','', PARAM_INT);
-            $ptags = optional_param('ptags','', PARAM_INT);
-
+            
             $tag = NULL;
             $tag->entryid = $entryID;
             $tag->userid = $USER->id;
             $tag->timemodified = time();
 
             /// Add tags information
-            foreach ($otags as $otag) {
-                $tag->tagid = $otag;
-                insert_record('blog_tag_instance',$tag);
+            if ($otags = optional_param('otags','', PARAM_INT)) {
+                foreach ($otags as $otag) {
+                    $tag->tagid = $otag;
+                    insert_record('blog_tag_instance',$tag);
+                }
             }
 
-            foreach ($ptags as $ptag) {
-                $tag->tagid = $ptag;
-                insert_record('blog_tag_instance',$tag);
+            if ($ptags = optional_param('ptags','', PARAM_INT)) {
+                foreach ($ptags as $ptag) {
+                    $tag->tagid = $ptag;
+                    insert_record('blog_tag_instance',$tag);
+                }
             }
 
             print '<strong>'. get_string('entrysaved', 'blog') .'</strong><br />';