### Eclipse Workspace Patch 1.0
#P moodle
Index: mod/hotpot/restorelib.php
===================================================================
RCS file: /cvsroot/moodle/moodle/mod/hotpot/restorelib.php,v
retrieving revision 1.28
diff -u -r1.28 restorelib.php
--- mod/hotpot/restorelib.php	8 Jun 2008 19:37:17 -0000	1.28
+++ mod/hotpot/restorelib.php	9 Jun 2008 13:37:40 -0000
@@ -78,7 +78,7 @@
         $more_restore = '';
         // print a message after each hotpot is backed up
         if (!defined('RESTORE_SILENTLY')) {
-            $more_restore .= 'print "<li>".get_string("modulename", "hotpot")." &quot;".format_string(stripslashes($record->name),true)."&quot;</li>";';
+            $more_restore .= 'print "<li>".get_string("modulename", "hotpot")." &quot;".format_string($record->name,true)."&quot;</li>";';
         }
         $more_restore .= 'backup_flush(300);';
         if (function_exists('restore_userdata_selected')) {
@@ -148,7 +148,6 @@
     $more_restore .= 'hotpot_restore_details($restore, $status, $xml, $record);';
     if ($hotpot_v20) {
         // HotPot v2.0.x (regenerate questions and responses from details)
-        $more_restore .= '$record->details=stripslashes($record->details);';
         $more_restore .= 'hotpot_add_attempt_details($record);'; // see "hotpot/lib.php"
     } else {
         // HotPot v2.1+
Index: mod/hotpot/lib.php
===================================================================
RCS file: /cvsroot/moodle/moodle/mod/hotpot/lib.php,v
retrieving revision 1.99
diff -u -r1.99 lib.php
--- mod/hotpot/lib.php	8 Jun 2008 19:37:17 -0000	1.99
+++ mod/hotpot/lib.php	9 Jun 2008 13:37:40 -0000
@@ -665,9 +665,9 @@
                 hotpot_get_titles_and_next_ex($hotpot, $xml_quiz->filepath);
             }
             if ($textfield=='name') {
-                $hotpot->$textfield = addslashes($hotpot->exercisetitle);
+                $hotpot->$textfield = $hotpot->exercisetitle;
             } else if ($textfield=='summary') {
-                $hotpot->$textfield = addslashes($hotpot->exercisesubtitle);
+                $hotpot->$textfield = $hotpot->exercisesubtitle;
             }
         }
         switch ($hotpot->$textsource) {
Index: mod/hotpot/attempt.php
===================================================================
RCS file: /cvsroot/moodle/moodle/mod/hotpot/attempt.php,v
retrieving revision 1.23
diff -u -r1.23 attempt.php
--- mod/hotpot/attempt.php	8 Jun 2008 16:07:11 -0000	1.23
+++ mod/hotpot/attempt.php	9 Jun 2008 13:37:37 -0000
@@ -102,7 +102,7 @@
     }
 
     // remove slashes added by lib/setup.php
-    $attempt->details = stripslashes($attempt->details);
+    $attempt->details = $attempt->details;
 
     // add details of this attempt
     hotpot_add_attempt_details($attempt);
Index: admin/xmldb/actions/view_statement_xml/view_statement_xml.class.php
===================================================================
RCS file: /cvsroot/moodle/moodle/admin/xmldb/actions/view_statement_xml/view_statement_xml.class.php,v
retrieving revision 1.4
diff -u -r1.4 view_statement_xml.class.php
--- admin/xmldb/actions/view_statement_xml/view_statement_xml.class.php	10 Oct 2007 05:25:31 -0000	1.4
+++ admin/xmldb/actions/view_statement_xml/view_statement_xml.class.php	9 Jun 2008 13:36:14 -0000
@@ -65,7 +65,7 @@
         $select = required_param('select', PARAM_ALPHA); //original/edited
     /// Get the dir containing the file
         $dirpath = required_param('dir', PARAM_PATH);
-        $dirpath = $CFG->dirroot . stripslashes_safe($dirpath);
+        $dirpath = $CFG->dirroot . $dirpath;
 
     /// Get the correct dir
         if ($select == 'original') {
Index: admin/xmldb/actions/edit_statement_save/edit_statement_save.class.php
===================================================================
RCS file: /cvsroot/moodle/moodle/admin/xmldb/actions/edit_statement_save/edit_statement_save.class.php,v
retrieving revision 1.4
diff -u -r1.4 edit_statement_save.class.php
--- admin/xmldb/actions/edit_statement_save/edit_statement_save.class.php	10 Oct 2007 05:25:20 -0000	1.4
+++ admin/xmldb/actions/edit_statement_save/edit_statement_save.class.php	9 Jun 2008 13:36:10 -0000
@@ -64,12 +64,12 @@
 
     /// Get parameters
         $dirpath = required_param('dir', PARAM_PATH);
-        $dirpath = $CFG->dirroot . stripslashes_safe($dirpath);
+        $dirpath = $CFG->dirroot . $dirpath;
 
         $statementparam = strtolower(required_param('statement', PARAM_CLEAN));
         $name = trim(strtolower(required_param('name', PARAM_CLEAN)));
         $comment = required_param('comment', PARAM_CLEAN);
-        $comment = stripslashes_safe($comment);
+        $comment = $comment;
 
         $editeddir =& $XMLDB->editeddirs[$dirpath];
         $structure =& $editeddir->xml_file->getStructure();
Index: mod/lesson/essay.php
===================================================================
RCS file: /cvsroot/moodle/moodle/mod/lesson/essay.php,v
retrieving revision 1.13
diff -u -r1.13 essay.php
--- mod/lesson/essay.php	9 Jun 2008 12:29:40 -0000	1.13
+++ mod/lesson/essay.php	9 Jun 2008 13:37:41 -0000
@@ -81,7 +81,7 @@
             }
             break;
         case 'update':
-            if (confirm_sesskey() and $form = data_submitted($CFG->wwwroot.'/mod/lesson/essay.php')) {
+            if (confirm_sesskey() and $form = data_submitted()) {
                 if (optional_param('cancel', 0)) {
                     redirect("$CFG->wwwroot/mod/lesson/essay.php?id=$cm->id");
                 }
@@ -101,7 +101,7 @@
 
                 $essayinfo->graded = 1;
                 $essayinfo->score = clean_param($form->score, PARAM_INT);
-                $essayinfo->response = stripslashes_safe(clean_param($form->response, PARAM_RAW));
+                $essayinfo->response = clean_param($form->response, PARAM_RAW);
                 $essayinfo->sent = 0;
                 if (!$lesson->custom && $essayinfo->score == 1) {
                     $attempt->correct = 1;
@@ -109,7 +109,7 @@
                     $attempt->correct = 0;
                 }
 
-                $attempt->useranswer = addslashes(serialize($essayinfo));
+                $attempt->useranswer = serialize($essayinfo);
 
                 if (!$DB->update_record('lesson_attempts', $attempt)) {
                     print_error('Could not update essay score');
@@ -207,7 +207,7 @@
                     
                     // Set rest of the message values
                     $a->question = format_text($pages[$attempt->pageid]->contents, FORMAT_MOODLE, $options);
-                    $a->response = s(stripslashes_safe($essayinfo->answer));
+                    $a->response = s($essayinfo->answer);
                     $a->teacher  = $course->teacher;
                     $a->comment  = s($essayinfo->response);
                     
@@ -221,7 +221,7 @@
 
                     if(email_to_user($users[$attempt->userid], $USER, $subject, $plaintxt, $message)) {
                         $essayinfo->sent = 1;
-                        $attempt->useranswer = addslashes(serialize($essayinfo));
+                        $attempt->useranswer = serialize($essayinfo);
                         $DB->update_record('lesson_attempts', $attempt);
                         // Log it
                         add_to_log($course->id, 'lesson', 'update email essay grade', "essay.php?id=$cm->id", format_string($pages[$attempt->pageid]->title,true).': '.fullname($users[$attempt->userid]), $cm->id);
@@ -348,7 +348,7 @@
             $essayinfo = unserialize($attempt->useranswer);
             
             $table->head = array(get_string('studentresponse', 'lesson', fullname($user, true)));
-            $table->data[] = array(s(stripslashes_safe($essayinfo->answer)));
+            $table->data[] = array(s($essayinfo->answer));
 
             print_table($table);
 
Index: mod/lesson/view.php
===================================================================
RCS file: /cvsroot/moodle/moodle/mod/lesson/view.php,v
retrieving revision 1.135
diff -u -r1.135 view.php
--- mod/lesson/view.php	9 Jun 2008 12:29:40 -0000	1.135
+++ mod/lesson/view.php	9 Jun 2008 13:37:44 -0000
@@ -749,7 +749,7 @@
                 case LESSON_ESSAY :
                     if (isset($USER->modattempts[$lesson->id])) {
                         $essayinfo = unserialize($attempt->useranswer);
-                        $value = s(stripslashes_safe($essayinfo->answer));
+                        $value = s($essayinfo->answer);
                     } else {
                         $value = "";
                     }
Index: mod/lesson/highscores.php
===================================================================
RCS file: /cvsroot/moodle/moodle/mod/lesson/highscores.php,v
retrieving revision 1.9
diff -u -r1.9 highscores.php
--- mod/lesson/highscores.php	9 Jun 2008 02:08:59 -0000	1.9
+++ mod/lesson/highscores.php	9 Jun 2008 13:37:41 -0000
@@ -25,7 +25,7 @@
     switch ($mode) {
         case 'add':
             // Ensure that we came from view.php
-            if (!confirm_sesskey() or !data_submitted("$CFG->wwwroot/mod/lesson/view.php")) {
+            if (!confirm_sesskey() or !data_submitted()) {
                 print_error('Incorrect Form Data');
             }
             break;
Index: mod/lesson/format.php
===================================================================
RCS file: /cvsroot/moodle/moodle/mod/lesson/format.php,v
retrieving revision 1.9
diff -u -r1.9 format.php
--- mod/lesson/format.php	6 Jun 2008 04:03:41 -0000	1.9
+++ mod/lesson/format.php	9 Jun 2008 13:37:41 -0000
@@ -60,7 +60,7 @@
                 case MATCH :
                     $count++;
 
-                    echo "<hr><p><b>$count</b>. ".stripslashes($question->questiontext)."</p>";
+                    echo "<hr><p><b>$count</b>. ".$question->questiontext."</p>";
                     $newpage = new stdClass;
                     $newpage->lessonid = $lesson->id;
                     $newpage->qtype = $this->qtypeconvert[$question->qtype];
Index: mod/lesson/report.php
===================================================================
RCS file: /cvsroot/moodle/moodle/mod/lesson/report.php,v
retrieving revision 1.45
diff -u -r1.45 report.php
--- mod/lesson/report.php	9 Jun 2008 12:29:41 -0000	1.45
+++ mod/lesson/report.php	9 Jun 2008 13:37:43 -0000
@@ -47,7 +47,7 @@
 
 /// Process any form data before fetching attempts, grades and times
     if (has_capability('mod/lesson:edit', $context) and 
-        $form = data_submitted($CFG->wwwroot.'/mod/lesson/report.php') and 
+        $form = data_submitted() and 
         confirm_sesskey()) {
     /// Cycle through array of userids with nested arrays of tries
         if (!empty($form->attempts)) {
@@ -791,7 +791,7 @@
                                 // dont think this should ever be reached....
                                 $avescore = get_string("nooneansweredthisquestion", "lesson");
                             }
-                            $answerdata->answers[] = array(s(stripslashes_safe($essayinfo->answer)), $avescore);
+                            $answerdata->answers[] = array(s($essayinfo->answer), $avescore);
                             break;
                         case LESSON_BRANCHTABLE :
                             $data = "<input type=\"button\" name=\"$answer->id\" value=\"".strip_tags(format_text($answer->answer, FORMAT_MOODLE,$formattextdefoptions))."\" disabled=\"disabled\"> ";
Index: grade/export/key.php
===================================================================
RCS file: /cvsroot/moodle/moodle/grade/export/key.php,v
retrieving revision 1.7
diff -u -r1.7 key.php
--- grade/export/key.php	3 Jun 2008 16:11:01 -0000	1.7
+++ grade/export/key.php	9 Jun 2008 13:36:40 -0000
@@ -89,7 +89,7 @@
 if ($editform->is_cancelled()) {
     redirect($returnurl);
 
-} elseif ($data = $editform->get_data(false)) {
+} elseif ($data = $editform->get_data()) {
 
     if ($data->id) {
         $record = new object();
Index: login/forgot_password.php
===================================================================
RCS file: /cvsroot/moodle/moodle/login/forgot_password.php,v
retrieving revision 1.49
diff -u -r1.49 forgot_password.php
--- login/forgot_password.php	2 Jun 2008 21:39:25 -0000	1.49
+++ login/forgot_password.php	9 Jun 2008 13:37:16 -0000
@@ -43,7 +43,7 @@
         print_header($strforgotten, $strforgotten, $navigation);
         print_error('secretalreadyused');
 
-    } else if (!empty($user) and $user->secret == stripslashes($p_secret)) {
+    } else if (!empty($user) and $user->secret == $p_secret) {
         // make sure that url relates to a valid user
 
         // check this isn't guest user
Index: login/signup.php
===================================================================
RCS file: /cvsroot/moodle/moodle/login/signup.php,v
retrieving revision 1.59
diff -u -r1.59 signup.php
--- login/signup.php	30 May 2008 22:11:32 -0000	1.59
+++ login/signup.php	9 Jun 2008 13:37:16 -0000
@@ -31,7 +31,7 @@
     if ($mform_signup->is_cancelled()) {
         redirect($CFG->httpswwwroot.'/login/index.php');
 
-    } else if ($user = $mform_signup->get_data(false)) {
+    } else if ($user = $mform_signup->get_data()) {
         $user->confirmed   = 0;
         $user->lang        = current_language();
         $user->firstaccess = time();
Index: login/change_password.php
===================================================================
RCS file: /cvsroot/moodle/moodle/login/change_password.php,v
retrieving revision 1.65
diff -u -r1.65 change_password.php
--- login/change_password.php	31 May 2008 17:48:52 -0000	1.65
+++ login/change_password.php	9 Jun 2008 13:37:16 -0000
@@ -62,7 +62,7 @@
 
     if ($mform->is_cancelled()) {
         redirect($CFG->wwwroot.'/user/view.php?id='.$USER->id.'&amp;course='.$course->id);
-    } else if ($data = $mform->get_data(false)) {
+    } else if ($data = $mform->get_data()) {
 
         if (!$userauth->user_update_password($USER, $data->newpassword1)) {
             print_error('errorpasswordupdate', 'auth');
Index: login/index.php
===================================================================
RCS file: /cvsroot/moodle/moodle/login/index.php,v
retrieving revision 1.135
diff -u -r1.135 index.php
--- login/index.php	5 Jun 2008 18:03:23 -0000	1.135
+++ login/index.php	9 Jun 2008 13:37:16 -0000
@@ -90,11 +90,11 @@
         if ($user) {
             $frm->username = $user->username;
         } else {
-            $frm = data_submitted(false);
+            $frm = data_submitted();
         }
 
     } else {
-        $frm = data_submitted(false);
+        $frm = data_submitted();
     }
 
 /// Check if the user has actually submitted login data to us
Index: tag/tag_autocomplete.php
===================================================================
RCS file: /cvsroot/moodle/moodle/tag/tag_autocomplete.php,v
retrieving revision 1.9
diff -u -r1.9 tag_autocomplete.php
--- tag/tag_autocomplete.php	2 Apr 2008 07:17:18 -0000	1.9
+++ tag/tag_autocomplete.php	9 Jun 2008 13:38:05 -0000
@@ -9,7 +9,7 @@
     print_error('tagsaredisabled', 'tag');
 }
 
-$query = addslashes(optional_param('query', '', PARAM_RAW));  
+$query = optional_param('query', '', PARAM_RAW);  
 
 if ($similar_tags = tag_autocomplete($query)) {
     foreach ($similar_tags as $tag) {
Index: tag/edit.php
===================================================================
RCS file: /cvsroot/moodle/moodle/tag/edit.php,v
retrieving revision 1.24
diff -u -r1.24 edit.php
--- tag/edit.php	28 Apr 2008 08:27:10 -0000	1.24
+++ tag/edit.php	9 Jun 2008 13:38:05 -0000
@@ -58,7 +58,7 @@
 // If new data has been sent, update the tag record
 if ($tagnew = $tagform->get_data()) {
 
-    tag_description_set($tag_id, stripslashes($tagnew->description), $tagnew->descriptionformat);
+    tag_description_set($tag_id, $tagnew->description, $tagnew->descriptionformat);
 
     if (has_capability('moodle/tag:manage', $systemcontext)) {
         if (($tag->tagtype != 'default') && (!isset($tagnew->tagtype) || ($tagnew->tagtype != '1'))) {
Index: admin/xmldb/actions/save_xml_file/save_xml_file.class.php
===================================================================
RCS file: /cvsroot/moodle/moodle/admin/xmldb/actions/save_xml_file/save_xml_file.class.php,v
retrieving revision 1.5
diff -u -r1.5 save_xml_file.class.php
--- admin/xmldb/actions/save_xml_file/save_xml_file.class.php	10 Oct 2007 05:25:30 -0000	1.5
+++ admin/xmldb/actions/save_xml_file/save_xml_file.class.php	9 Jun 2008 13:36:14 -0000
@@ -62,7 +62,7 @@
 
     /// Get the dir containing the file
         $dirpath = required_param('dir', PARAM_PATH);
-        $dirpath = $CFG->dirroot . stripslashes_safe($dirpath);
+        $dirpath = $CFG->dirroot . $dirpath;
 
     /// Get the edited dir
         if (!empty($XMLDB->editeddirs)) {
Index: course/index.php
===================================================================
RCS file: /cvsroot/moodle/moodle/course/index.php,v
retrieving revision 1.98
diff -u -r1.98 index.php
--- course/index.php	2 Jun 2008 21:39:23 -0000	1.98
+++ course/index.php	9 Jun 2008 13:36:33 -0000
@@ -114,7 +114,7 @@
         if ($mform->is_cancelled()) {
             redirect('index.php');
 
-        } else if (!$data= $mform->get_data(false)) {
+        } else if (!$data= $mform->get_data()) {
             require_once($CFG->libdir . '/questionlib.php');
             print_category_edit_header();
             print_heading($heading);
Index: course/search.php
===================================================================
RCS file: /cvsroot/moodle/moodle/course/search.php,v
retrieving revision 1.56
diff -u -r1.56 search.php
--- course/search.php	2 Jun 2008 08:13:24 -0000	1.56
+++ course/search.php	9 Jun 2008 13:36:35 -0000
@@ -15,8 +15,6 @@
     $blocklist = optional_param('blocklist', 0, PARAM_INT);
     $modulelist= optional_param('modulelist', '', PARAM_ALPHAEXT);
 
-    $search = stripslashes($search); // TODO: remove soon
-
     $search = trim(strip_tags($search)); // trim & clean raw searched string
 
     if ($search) {
@@ -107,7 +105,7 @@
         exit;
     }
 
-    if (!empty($moveto) and $data = data_submitted(false) and confirm_sesskey()) {   // Some courses are being moved
+    if (!empty($moveto) and $data = data_submitted() and confirm_sesskey()) {   // Some courses are being moved
 
         if (! $destcategory = $DB->get_record("course_categories", array("id"=>$data->moveto))) {
             print_error('cannotfindcategory', '', '', $data->moveto);
Index: course/request.php
===================================================================
RCS file: /cvsroot/moodle/moodle/course/request.php,v
retrieving revision 1.17
diff -u -r1.17 request.php
--- course/request.php	2 Jun 2008 21:25:40 -0000	1.17
+++ course/request.php	9 Jun 2008 13:36:34 -0000
@@ -33,7 +33,7 @@
 
         redirect($CFG->wwwroot);
 
-    }elseif ($data = $requestform->get_data(false)) {
+    }elseif ($data = $requestform->get_data()) {
         $data->requester = $USER->id;
 
         if ($DB->insert_record('course_request', $data)) {
Index: course/pending.php
===================================================================
RCS file: /cvsroot/moodle/moodle/course/pending.php,v
retrieving revision 1.17
diff -u -r1.17 pending.php
--- course/pending.php	2 Jun 2008 08:13:24 -0000	1.17
+++ course/pending.php	9 Jun 2008 13:36:34 -0000
@@ -16,9 +16,6 @@
 
     if (!empty($approve) and confirm_sesskey()) {
         if ($course = $DB->get_record("course_request", array("id"=>$approve))) {
-            foreach (array_keys((array)$course) as $key) {
-                $course->$key = addslashes($course->$key);
-            }
 
             // place at beginning of category
             fix_course_sortorder();
Index: course/reset.php
===================================================================
RCS file: /cvsroot/moodle/moodle/course/reset.php,v
retrieving revision 1.11
diff -u -r1.11 reset.php
--- course/reset.php	1 Jun 2008 17:59:13 -0000	1.11
+++ course/reset.php	9 Jun 2008 13:36:34 -0000
@@ -32,7 +32,7 @@
 if ($mform->is_cancelled()) {
     redirect($CFG->wwwroot.'/course/view.php?id='.$id);
 
-} else if ($data = $mform->get_data(false)) { // no magic quotes
+} else if ($data = $mform->get_data()) { // no magic quotes
 
     if (isset($data->selectdefault)) {
         $_POST = array();
Index: course/modedit.php
===================================================================
RCS file: /cvsroot/moodle/moodle/course/modedit.php,v
retrieving revision 1.52
diff -u -r1.52 modedit.php
--- course/modedit.php	1 Jun 2008 21:51:13 -0000	1.52
+++ course/modedit.php	9 Jun 2008 13:36:34 -0000
@@ -190,7 +190,7 @@
         } else {
             redirect("$CFG->wwwroot/course/view.php?id=$course->id#section-".$cw->section);
         }
-    } else if ($fromform = $mform->get_data(false)) {
+    } else if ($fromform = $mform->get_data()) {
         if (empty($fromform->coursemodule)) { //add
             $cm = null;
             if (! $course = $DB->get_record("course", array("id"=>$fromform->course))) {
@@ -337,7 +337,7 @@
             if ($fromform->gradecat == -1) {
                 $grade_category = new grade_category();
                 $grade_category->courseid = $COURSE->id;
-                $grade_category->fullname = stripslashes($fromform->name);
+                $grade_category->fullname = $fromform->name;
                 $grade_category->insert();
                 if ($grade_item) {
                     $parent = $grade_item->get_parent_category();
Index: course/importstudents.php
===================================================================
RCS file: /cvsroot/moodle/moodle/course/importstudents.php,v
retrieving revision 1.29
diff -u -r1.29 importstudents.php
--- course/importstudents.php	1 Jun 2008 18:17:38 -0000	1.29
+++ course/importstudents.php	9 Jun 2008 13:36:32 -0000
@@ -15,8 +15,6 @@
     $previoussearch = optional_param('previoussearch', 0, PARAM_BOOL);
     $previoussearch = ($searchtext != '') or ($previoussearch) ? 1:0;
 
-    $searchtext = stripslashes($searchtext); // TODO: remove soon
-
     if (! $site = get_site()) {
         redirect("$CFG->wwwroot/$CFG->admin/index.php");
     }
@@ -54,7 +52,7 @@
 
     print_heading(get_string('childcourses'));
 
-    if (!$frm = data_submitted(false)) {
+    if (!$frm = data_submitted()) {
         $note = get_string("importmetacoursenote");
         print_simple_box($note, "center", "50%");
 
Index: course/editcategory.php
===================================================================
RCS file: /cvsroot/moodle/moodle/course/editcategory.php,v
retrieving revision 1.16
diff -u -r1.16 editcategory.php
--- course/editcategory.php	7 Jun 2008 15:44:19 -0000	1.16
+++ course/editcategory.php	9 Jun 2008 13:36:32 -0000
@@ -54,7 +54,7 @@
     } else {
         redirect($CFG->wwwroot.'/course/category.php?categoryedit=on&id='.$category->id);
     } 
-} else if (($data = $mform->get_data(false))) {
+} else if (($data = $mform->get_data())) {
     $newcategory = new stdClass();
     $newcategory->name        = $data->name;
     $newcategory->description = $data->description;
Index: course/edit.php
===================================================================
RCS file: /cvsroot/moodle/moodle/course/edit.php,v
retrieving revision 1.112
diff -u -r1.112 edit.php
--- course/edit.php	30 May 2008 16:47:22 -0000	1.112
+++ course/edit.php	9 Jun 2008 13:36:32 -0000
@@ -78,7 +78,7 @@
             redirect($CFG->wwwroot.'/course/view.php?id='.$course->id);
         }
 
-    } else if ($data = $editform->get_data(false)) {
+    } else if ($data = $editform->get_data()) {
 
         $data->password = $data->enrolpassword;  // we need some other name for password field MDL-9929
 /// process data if submitted
Index: course/info.php
===================================================================
RCS file: /cvsroot/moodle/moodle/course/info.php,v
retrieving revision 1.26
diff -u -r1.26 info.php
--- course/info.php	2 Jun 2008 08:13:24 -0000	1.26
+++ course/info.php	9 Jun 2008 13:36:33 -0000
@@ -8,8 +8,6 @@
     $id   = optional_param('id', false, PARAM_INT); // Course id
     $name = optional_param('name', false, PARAM_RAW); // Course short name
 
-    $name = stripslashes($name); // TODO: remove soon
-
     if (!$id and !$name) {
         print_error("unspecifycourseid");
     }
Index: course/category.php
===================================================================
RCS file: /cvsroot/moodle/moodle/course/category.php,v
retrieving revision 1.131
diff -u -r1.131 category.php
--- course/category.php	2 Jun 2008 21:47:31 -0000	1.131
+++ course/category.php	9 Jun 2008 13:36:32 -0000
@@ -19,8 +19,6 @@
     $resort       = optional_param('resort', 0, PARAM_BOOL);
     $categorytheme= optional_param('categorytheme', false, PARAM_CLEAN);
 
-    $rename = stripslashes($rename); // TODO: remove soon
-
     if ($CFG->forcelogin) {
         require_login();
     }
@@ -164,7 +162,7 @@
     if ($creatorediting) {
     /// Move a specified course to a new category
 
-        if (!empty($moveto) and $data = data_submitted(false) and confirm_sesskey()) {   // Some courses are being moved
+        if (!empty($moveto) and $data = data_submitted() and confirm_sesskey()) {   // Some courses are being moved
 
             // user must have category update in both cats to perform this
             require_capability('moodle/category:update', $context);
Index: course/recent.php
===================================================================
RCS file: /cvsroot/moodle/moodle/course/recent.php,v
retrieving revision 1.38
diff -u -r1.38 recent.php
--- course/recent.php	2 Jun 2008 08:13:24 -0000	1.38
+++ course/recent.php	9 Jun 2008 13:36:34 -0000
@@ -37,7 +37,7 @@
 
     $mform = new recent_form();
     $mform->set_data($param);
-    if ($formdata = $mform->get_data(false)) {
+    if ($formdata = $mform->get_data()) {
         $param = $formdata;
     }
 
Index: course/editsection.php
===================================================================
RCS file: /cvsroot/moodle/moodle/course/editsection.php,v
retrieving revision 1.29
diff -u -r1.29 editsection.php
--- course/editsection.php	6 Jun 2008 01:49:07 -0000	1.29
+++ course/editsection.php	9 Jun 2008 13:36:32 -0000
@@ -20,7 +20,7 @@
 
 /// If data submitted, then process and store.
 
-    if ($form = data_submitted(false) and confirm_sesskey()) {
+    if ($form = data_submitted() and confirm_sesskey()) {
 
         $timenow = time();
 
Index: admin/mnet/adminlib.php
===================================================================
RCS file: /cvsroot/moodle/moodle/admin/mnet/adminlib.php,v
retrieving revision 1.6
diff -u -r1.6 adminlib.php
--- admin/mnet/adminlib.php	2 Jun 2008 21:25:41 -0000	1.6
+++ admin/mnet/adminlib.php	9 Jun 2008 13:36:05 -0000
@@ -87,7 +87,7 @@
                 array_unshift($profile, $details['returns']);
             }
             $dataobject->profile       = serialize($profile);
-            $dataobject->help          = addslashes($details['description']);
+            $dataobject->help          = $details['description'];
         } else {
             $dataobject->profile       = serialize(array(array('type' => 'void', 'description' => 'No return value')));
             $dataobject->help          = '';
Index: admin/mnet/enr_course_enrol.php
===================================================================
RCS file: /cvsroot/moodle/moodle/admin/mnet/enr_course_enrol.php,v
retrieving revision 1.12
diff -u -r1.12 enr_course_enrol.php
--- admin/mnet/enr_course_enrol.php	2 Jun 2008 21:25:41 -0000	1.12
+++ admin/mnet/enr_course_enrol.php	9 Jun 2008 13:36:05 -0000
@@ -50,7 +50,7 @@
 
 /// Process incoming role assignment
 
-    if ($frm = data_submitted(false)) {
+    if ($frm = data_submitted()) {
         if ($add and !empty($frm->addselect) and confirm_sesskey()) {
             $timemodified = time();
 
Index: admin/mnet/MethodTable.php
===================================================================
RCS file: /cvsroot/moodle/moodle/admin/mnet/MethodTable.php,v
retrieving revision 1.1
diff -u -r1.1 MethodTable.php
--- admin/mnet/MethodTable.php	4 Jan 2007 02:33:51 -0000	1.1
+++ admin/mnet/MethodTable.php	9 Jun 2008 13:36:05 -0000
@@ -556,7 +556,7 @@
                 if($key=="arguments"){
                     $result .= "array(";
                     for($i=0; $i<count($value); $i++){
-                        $result .= "\"" . addslashes($value[$i]) . "\"";
+                        $result .= "\"" . addslashes($value[$i]) . "\""; // TODO: fix this addslashes
                         if($i<count($value)-1){
                             $result .= ", ";
                         }
Index: admin/mnet/index.php
===================================================================
RCS file: /cvsroot/moodle/moodle/admin/mnet/index.php,v
retrieving revision 1.18
diff -u -r1.18 index.php
--- admin/mnet/index.php	31 May 2008 11:41:27 -0000	1.18
+++ admin/mnet/index.php	9 Jun 2008 13:36:05 -0000
@@ -37,7 +37,7 @@
     }
 
 /// If data submitted, process and store
-    if (($form = data_submitted(false)) && confirm_sesskey()) {
+    if (($form = data_submitted()) && confirm_sesskey()) {
         if (!empty($form->submit) && $form->submit == get_string('savechanges')) {
             if (in_array($form->mode, array("off", "strict", "dangerous"))) {
                 if (set_config('mnet_dispatcher_mode', $form->mode)) {
Index: admin/mnet/mnet_themes.php
===================================================================
RCS file: /cvsroot/moodle/moodle/admin/mnet/mnet_themes.php,v
retrieving revision 1.2
diff -u -r1.2 mnet_themes.php
--- admin/mnet/mnet_themes.php	19 Dec 2007 17:35:27 -0000	1.2
+++ admin/mnet/mnet_themes.php	9 Jun 2008 13:36:05 -0000
@@ -65,7 +65,7 @@
                 $report = array('This theme is not installed!'.'3', 'errorbox');
             } else {
                 $mnet_peer->force_theme = 1;
-                $mnet_peer->theme = addslashes($choose);
+                $mnet_peer->theme = $choose;
                 if ($mnet_peer->commit()) {
                     $report = array(get_string('themesaved').'1', 'informationbox');
                 } else {
Index: admin/mnet/access_control.php
===================================================================
RCS file: /cvsroot/moodle/moodle/admin/mnet/access_control.php,v
retrieving revision 1.18
diff -u -r1.18 access_control.php
--- admin/mnet/access_control.php	31 May 2008 11:41:27 -0000	1.18
+++ admin/mnet/access_control.php	9 Jun 2008 13:36:05 -0000
@@ -80,7 +80,7 @@
 
 
 // process the form results
-if ($form = data_submitted(false) and confirm_sesskey()) {
+if ($form = data_submitted() and confirm_sesskey()) {
 
     // check permissions and verify form input
     if (!has_capability('moodle/user:delete', $sitecontext)) {
Index: admin/xmldb/actions/edit_index_save/edit_index_save.class.php
===================================================================
RCS file: /cvsroot/moodle/moodle/admin/xmldb/actions/edit_index_save/edit_index_save.class.php,v
retrieving revision 1.8
diff -u -r1.8 edit_index_save.class.php
--- admin/xmldb/actions/edit_index_save/edit_index_save.class.php	20 May 2008 23:24:40 -0000	1.8
+++ admin/xmldb/actions/edit_index_save/edit_index_save.class.php	9 Jun 2008 13:36:09 -0000
@@ -69,24 +69,24 @@
 
     /// Do the job, setting result as needed
 
-        if (!data_submitted('nomatch')) { ///Basic prevention
+        if (!data_submitted()) { ///Basic prevention
             print_error('wrongcall', 'error');
         }
 
     /// Get parameters
         $dirpath = required_param('dir', PARAM_PATH);
-        $dirpath = $CFG->dirroot . stripslashes_safe($dirpath);
+        $dirpath = $CFG->dirroot . $dirpath;
 
         $tableparam = strtolower(required_param('table', PARAM_PATH));
         $indexparam = strtolower(required_param('index', PARAM_PATH));
         $name = trim(strtolower(optional_param('name', $indexparam, PARAM_PATH)));
 
         $comment = required_param('comment', PARAM_CLEAN);
-        $comment = trim(stripslashes_safe($comment));
+        $comment = trim($comment);
 
         $unique = required_param('unique', PARAM_INT);
         $fields = required_param('fields', PARAM_CLEAN);
-        $fields = str_replace(' ', '', trim(strtolower(stripslashes_safe($fields))));
+        $fields = str_replace(' ', '', trim(strtolower($fields)));
 
         $editeddir =& $XMLDB->editeddirs[$dirpath];
         $structure =& $editeddir->xml_file->getStructure();
Index: grade/edit/scale/edit.php
===================================================================
RCS file: /cvsroot/moodle/moodle/grade/edit/scale/edit.php,v
retrieving revision 1.9
diff -u -r1.9 edit.php
--- grade/edit/scale/edit.php	2 Jun 2008 16:06:35 -0000	1.9
+++ grade/edit/scale/edit.php	9 Jun 2008 13:36:39 -0000
@@ -92,7 +92,7 @@
 if ($mform->is_cancelled()) {
     redirect($returnurl);
 
-} else if ($data = $mform->get_data(false)) {
+} else if ($data = $mform->get_data()) {
     $scale = new grade_scale(array('id'=>$id));
     $data->userid = $USER->id;
     grade_scale::set_properties($scale, $data);
Index: user/editadvanced.php
===================================================================
RCS file: /cvsroot/moodle/moodle/user/editadvanced.php,v
retrieving revision 1.30
diff -u -r1.30 editadvanced.php
--- user/editadvanced.php	30 May 2008 22:11:31 -0000	1.30
+++ user/editadvanced.php	9 Jun 2008 13:38:06 -0000
@@ -68,7 +68,7 @@
     $userform = new user_editadvanced_form();
     $userform->set_data($user);
 
-    if ($usernew = $userform->get_data(false)) {
+    if ($usernew = $userform->get_data()) {
         add_to_log($course->id, 'user', 'update', "view.php?id=$user->id&course=$course->id", '');
 
         if (empty($usernew->auth)) {
@@ -96,7 +96,7 @@
                 print_error('Error updating user record');
             }
             // pass a true $userold here
-            if (! $authplugin->user_update($user, $userform->get_data(false))) {
+            if (! $authplugin->user_update($user, $userform->get_data())) {
                 // auth update failed, rollback for moodle
                 $DB->update_record('user', $user);
                 print_error('Failed to update user data on external auth: '.$user->auth.
Index: user/messageselect.php
===================================================================
RCS file: /cvsroot/moodle/moodle/user/messageselect.php,v
retrieving revision 1.23
diff -u -r1.23 messageselect.php
--- user/messageselect.php	31 May 2008 11:13:21 -0000	1.23
+++ user/messageselect.php	9 Jun 2008 13:38:06 -0000
@@ -94,7 +94,7 @@
 <input type="hidden" name="id" value="'.$id.'" />
 <input type="hidden" name="format" value="'.$format.'" />
 ';
-                echo "<h3>".get_string('previewhtml')."</h3><div class=\"messagepreview\">\n".format_text(stripslashes($messagebody),$format)."\n</div>\n";
+                echo "<h3>".get_string('previewhtml')."</h3><div class=\"messagepreview\">\n".format_text($messagebody,$format)."\n</div>\n";
                 echo '<p align="center"><input type="submit" name="send" value="'.get_string('sendmessage', 'message').'" />'."\n";
                 echo '<input type="submit" name="edit" value="'.get_string('update').'" /></p>';
                 echo "\n</form>";
@@ -102,7 +102,7 @@
                 $good = 1;
                 $teachers = array();
                 foreach ($SESSION->emailto[$id] as $user) {
-                    $good = $good && message_post_message($USER,$user,addslashes($messagebody),$format,'direct');
+                    $good = $good && message_post_message($USER,$user,$messagebody,$format,'direct');
                     if ($user->teacher) {
                         $teachers[] = $user->id;
                     }
Index: user/edit.php
===================================================================
RCS file: /cvsroot/moodle/moodle/user/edit.php,v
retrieving revision 1.174
diff -u -r1.174 edit.php
--- user/edit.php	30 May 2008 22:11:31 -0000	1.174
+++ user/edit.php	9 Jun 2008 13:38:05 -0000
@@ -89,7 +89,7 @@
     $userform = new user_edit_form();
     $userform->set_data($user);
 
-    if ($usernew = $userform->get_data(false)) {
+    if ($usernew = $userform->get_data()) {
 
         add_to_log($course->id, 'user', 'update', "view.php?id=$user->id&course=$course->id", '');
 
@@ -102,7 +102,7 @@
         }
 
         // pass a true $userold here
-        if (! $authplugin->user_update($user, $userform->get_data(false))) {
+        if (! $authplugin->user_update($user, $userform->get_data())) {
             // auth update failed, rollback for moodle
             $DB->update_record('user', $user);
             print_error('Failed to update user data on external auth: '.$user->auth.
Index: admin/uploadpicture.php
===================================================================
RCS file: /cvsroot/moodle/moodle/admin/uploadpicture.php,v
retrieving revision 1.7
diff -u -r1.7 uploadpicture.php
--- admin/uploadpicture.php	2 Jun 2008 21:39:24 -0000	1.7
+++ admin/uploadpicture.php	9 Jun 2008 13:36:03 -0000
@@ -62,7 +62,7 @@
 print_heading_with_help($struploadpictures, 'uploadpictures');
 
 $mform = new admin_uploadpicture_form();
-if ($formdata = $mform->get_data(false)) {
+if ($formdata = $mform->get_data()) {
     if (!array_key_exists($userfield, $userfields)) {
         notify(get_string('uploadpicture_baduserfield','admin'));
     } else {
Index: admin/settings.php
===================================================================
RCS file: /cvsroot/moodle/moodle/admin/settings.php,v
retrieving revision 1.45
diff -u -r1.45 settings.php
--- admin/settings.php	30 May 2008 21:36:57 -0000	1.45
+++ admin/settings.php	9 Jun 2008 13:36:03 -0000
@@ -31,7 +31,7 @@
 $errormsg  = '';
 $focus = '';
 
-if ($data = data_submitted(false) and confirm_sesskey()) {
+if ($data = data_submitted() and confirm_sesskey()) {
     if (admin_write_settings($data)) {
         $statusmsg = get_string('changessaved');
     }
Index: admin/cliupgrade.php
===================================================================
RCS file: /cvsroot/moodle/moodle/admin/cliupgrade.php,v
retrieving revision 1.14
diff -u -r1.14 cliupgrade.php
--- admin/cliupgrade.php	5 Jun 2008 18:01:22 -0000	1.14
+++ admin/cliupgrade.php	9 Jun 2008 13:36:01 -0000
@@ -738,14 +738,6 @@
         console_write(STDERR,"The PHP server variable 'file_uploads' is not turned On" ,'',false);
     }
 
-    if (empty($CFG->prefix) && $CFG->dbfamily != 'mysql') {  //Enforce prefixes for everybody but mysql
-        console_write(STDERR,'$CFG->prefix can\'t be empty for your target DB (' . $CFG->dbtype . ')','',false);
-    }
-
-    if ($CFG->dbfamily == 'oracle' && strlen($CFG->prefix) > 2) { //Max prefix length for Oracle is 2cc
-        console_write(STDERR,'$CFG->prefix maximum allowed length for Oracle DBs is 2cc.','',false);
-    }
-
     /// Check that config.php has been edited
 
     if ($CFG->wwwroot == "http://example.com/moodle") {
@@ -1193,9 +1185,9 @@
         }
 
         $newsite = new Object();
-        $newsite->fullname = addslashes($sitefullname);
-        $newsite->shortname = addslashes($siteshortname);
-        $newsite->summary = addslashes($sitesummary);
+        $newsite->fullname = $sitefullname;
+        $newsite->shortname = $siteshortname;
+        $newsite->summary = $sitesummary;
         $newsite->newsitems = $sitenewsitems;
         $newsite->numsections = 0;
         $newsite->category = 0;
Index: admin/maintenance.php
===================================================================
RCS file: /cvsroot/moodle/moodle/admin/maintenance.php,v
retrieving revision 1.15
diff -u -r1.15 maintenance.php
--- admin/maintenance.php	30 May 2008 21:36:57 -0000	1.15
+++ admin/maintenance.php	9 Jun 2008 13:36:03 -0000
@@ -15,7 +15,7 @@
 
     $filename = $CFG->dataroot.'/'.SITEID.'/maintenance.html';
 
-    if ($form = data_submitted(false)) {
+    if ($form = data_submitted()) {
         if (confirm_sesskey()) {
             if ($form->action == "disable") {
                 unlink($filename);
Index: admin/search.php
===================================================================
RCS file: /cvsroot/moodle/moodle/admin/search.php,v
retrieving revision 1.18
diff -u -r1.18 search.php
--- admin/search.php	30 May 2008 21:36:57 -0000	1.18
+++ admin/search.php	9 Jun 2008 13:36:03 -0000
@@ -7,8 +7,6 @@
 
 $query = trim(optional_param('query', '', PARAM_NOTAGS));  // Search string
 
-$query = stripslashes($query); // TODO: remove soon
-
 $adminroot =& admin_get_root(); // need all settings here
 $adminroot->search = $query; // So we can reference it in search boxes later in this invocation
 $statusmsg = '';
@@ -18,7 +16,7 @@
 admin_externalpage_setup('search'); // now hidden page
 
 // now we'll deal with the case that the admin has submitted the form with changed settings
-if ($data = data_submitted(false) and confirm_sesskey()) {
+if ($data = data_submitted() and confirm_sesskey()) {
     if (admin_write_settings($data)) {
         $statusmsg = get_string('changessaved');
     }
Index: admin/uploaduser.php
===================================================================
RCS file: /cvsroot/moodle/moodle/admin/uploaduser.php,v
retrieving revision 1.87
diff -u -r1.87 uploaduser.php
--- admin/uploaduser.php	30 May 2008 22:11:32 -0000	1.87
+++ admin/uploaduser.php	9 Jun 2008 13:36:05 -0000
@@ -125,7 +125,7 @@
     $cir->cleanup(true);
     redirect($returnurl);
 
-} else if ($formdata = $mform->get_data(false)) { // no magic quotes here!!!
+} else if ($formdata = $mform->get_data()) {
     // Print the header
     admin_externalpage_print_header();
     print_heading(get_string('uploadusersresult', 'admin'));
Index: admin/upgradesettings.php
===================================================================
RCS file: /cvsroot/moodle/moodle/admin/upgradesettings.php,v
retrieving revision 1.24
diff -u -r1.24 upgradesettings.php
--- admin/upgradesettings.php	30 May 2008 21:36:57 -0000	1.24
+++ admin/upgradesettings.php	9 Jun 2008 13:36:03 -0000
@@ -15,7 +15,7 @@
 admin_externalpage_setup('upgradesettings'); // now hidden page
 
 // now we'll deal with the case that the admin has submitted the form with new settings
-if ($data = data_submitted(false) and confirm_sesskey()) {
+if ($data = data_submitted() and confirm_sesskey()) {
     $count = admin_write_settings($data);
     $adminroot =& admin_get_root(true); //reload tree
 }
Index: admin/enrol_config.php
===================================================================
RCS file: /cvsroot/moodle/moodle/admin/enrol_config.php,v
retrieving revision 1.17
diff -u -r1.17 enrol_config.php
--- admin/enrol_config.php	30 May 2008 21:36:57 -0000	1.17
+++ admin/enrol_config.php	9 Jun 2008 13:36:01 -0000
@@ -17,7 +17,7 @@
 
 /// If data submitted, then process and store.
 
-    if ($frm = data_submitted(false)) {
+    if ($frm = data_submitted()) {
         if (!confirm_sesskey()) {
             print_error('confirmsesskeybad', 'error');
         }
Index: admin/lang.php
===================================================================
RCS file: /cvsroot/moodle/moodle/admin/lang.php,v
retrieving revision 1.119
diff -u -r1.119 lang.php
--- admin/lang.php	1 Jun 2008 11:18:54 -0000	1.119
+++ admin/lang.php	9 Jun 2008 13:36:03 -0000
@@ -1358,7 +1358,7 @@
     }
     error_reporting($CFG->debug);
 
-    fwrite($f, stripslashes($content));
+    fwrite($f, $content);
     fclose($f);
 
     // Remove file if its empty
Index: admin/replace.php
===================================================================
RCS file: /cvsroot/moodle/moodle/admin/replace.php,v
retrieving revision 1.13
diff -u -r1.13 replace.php
--- admin/replace.php	30 May 2008 21:36:58 -0000	1.13
+++ admin/replace.php	9 Jun 2008 13:36:03 -0000
@@ -10,9 +10,6 @@
 $search  = optional_param('search', '', PARAM_RAW);
 $replace = optional_param('replace', '', PARAM_RAW);
 
-$search  = stripslashes($search); // TODO: remove soon
-$replace = stripslashes($replace); // TODO: remove soon
-
 ###################################################################
 admin_externalpage_print_header();
 
Index: admin/filter.php
===================================================================
RCS file: /cvsroot/moodle/moodle/admin/filter.php,v
retrieving revision 1.23
diff -u -r1.23 filter.php
--- admin/filter.php	30 May 2008 21:36:57 -0000	1.23
+++ admin/filter.php	9 Jun 2008 13:36:01 -0000
@@ -27,7 +27,7 @@
     //======================
 
     // if reset pressed let filter config page handle it
-    if ($config = data_submitted(false) and !$forcereset) {
+    if ($config = data_submitted() and !$forcereset) {
 
         // check session key
         if (!confirm_sesskey()) {
Index: admin/auth_config.php
===================================================================
RCS file: /cvsroot/moodle/moodle/admin/auth_config.php,v
retrieving revision 1.21
diff -u -r1.21 auth_config.php
--- admin/auth_config.php	30 May 2008 21:16:16 -0000	1.21
+++ admin/auth_config.php	9 Jun 2008 13:36:00 -0000
@@ -18,7 +18,7 @@
 $returnurl = "$CFG->wwwroot/$CFG->admin/settings.php?section=manageauths";
 
 // save configuration changes
-if ($frm = data_submitted(false) and confirm_sesskey()) {
+if ($frm = data_submitted() and confirm_sesskey()) {
 
     $authplugin->validate_form($frm, $err);
 
Index: lib/datalib.php
===================================================================
RCS file: /cvsroot/moodle/moodle/lib/datalib.php,v
retrieving revision 1.478
diff -u -r1.478 datalib.php
--- lib/datalib.php	4 Jun 2008 21:34:14 -0000	1.478
+++ lib/datalib.php	9 Jun 2008 13:36:52 -0000
@@ -15,25 +15,6 @@
  define('LASTACCESS_UPDATE_SECS', 60); /// Number of seconds to wait before
                                        /// updating lastaccess information in DB.
 
-/**
- * Escape all dangerous characters in a data record
- *
- * $dataobject is an object containing needed data
- * Run over each field exectuting addslashes() function
- * to escape SQL unfriendly characters (e.g. quotes)
- * Handy when writing back data read from the database
- *
- * @param $dataobject Object containing the database record
- * @return object Same object with neccessary characters escaped
- */
-function addslashes_object( $dataobject ) {
-    $a = get_object_vars( $dataobject);
-    foreach ($a as $key=>$value) {
-      $a[$key] = addslashes( $value );
-    }
-    return (object)$a;
-}
-
 /// USER DATABASE ////////////////////////////////////////////////
 
 /**
Index: lib/dmllib.php
===================================================================
RCS file: /cvsroot/moodle/moodle/lib/dmllib.php,v
retrieving revision 1.164
diff -u -r1.164 dmllib.php
--- lib/dmllib.php	8 Jun 2008 15:25:04 -0000	1.164
+++ lib/dmllib.php	9 Jun 2008 13:36:52 -0000
@@ -251,14 +251,12 @@
 function insert_record($table, $dataobject, $returnid=true, $primarykey='id') {
     global $DB;
 
-    $dataobject = stripslashes_recursive($dataobject);
     return $DB->insert_record($table, $dataobject, $returnid);
 }
 
 function update_record($table, $dataobject) {
     global $DB;
 
-    $dataobject = stripslashes_recursive($dataobject);
     return $DB->update_record($table, $dataobject, true);
 }
 
@@ -267,7 +265,7 @@
 
     $conditions = array();
     if ($field) {
-        $conditions[$field] = stripslashes_recursive($value);
+        $conditions[$field] = $value;
     }
 
     return $DB->get_records($table, $conditions, $sort, $fields, $limitfrom, $limitnum);
@@ -278,13 +276,13 @@
 
     $conditions = array();
     if ($field1) {
-        $conditions[$field1] = stripslashes_recursive($value1);
+        $conditions[$field1] = $value1;
     }
     if ($field2) {
-        $conditions[$field2] = stripslashes_recursive($value2);
+        $conditions[$field2] = $value2;
     }
     if ($field3) {
-        $conditions[$field3] = stripslashes_recursive($value3);
+        $conditions[$field3] = $value3;
     }
 
     return $DB->get_record($table, $conditions, $fields);
@@ -295,16 +293,16 @@
 
     $conditions = array();
     if ($field1) {
-        $conditions[$field1] = stripslashes_recursive($value1);
+        $conditions[$field1] = $value1;
     }
     if ($field2) {
-        $conditions[$field2] = stripslashes_recursive($value2);
+        $conditions[$field2] = $value2;
     }
     if ($field3) {
-        $conditions[$field3] = stripslashes_recursive($value3);
+        $conditions[$field3] = $value3;
     }
 
-    return $DB->set_field($table, $newfield, stripslashes_recursive($newvalue), $conditions);
+    return $DB->set_field($table, $newfield, $newvalue, $conditions);
 }
 
 function count_records($table, $field1='', $value1='', $field2='', $value2='', $field3='', $value3='') {
@@ -312,13 +310,13 @@
 
     $conditions = array();
     if ($field1) {
-        $conditions[$field1] = stripslashes_recursive($value1);
+        $conditions[$field1] = $value1;
     }
     if ($field2) {
-        $conditions[$field2] = stripslashes_recursive($value2);
+        $conditions[$field2] = $value2;
     }
     if ($field3) {
-        $conditions[$field3] = stripslashes_recursive($value3);
+        $conditions[$field3] = $value3;
     }
 
     return $DB->count_records($table, $conditions);
@@ -329,13 +327,13 @@
 
     $conditions = array();
     if ($field1) {
-        $conditions[$field1] = stripslashes_recursive($value1);
+        $conditions[$field1] = $value1;
     }
     if ($field2) {
-        $conditions[$field2] = stripslashes_recursive($value2);
+        $conditions[$field2] = $value2;
     }
     if ($field3) {
-        $conditions[$field3] = stripslashes_recursive($value3);
+        $conditions[$field3] = $value3;
     }
 
     return $DB->record_exists($table, $conditions);
@@ -350,13 +348,13 @@
 
     $conditions = array();
     if ($field1) {
-        $conditions[$field1] = stripslashes_recursive($value1);
+        $conditions[$field1] = $value1;
     }
     if ($field2) {
-        $conditions[$field2] = stripslashes_recursive($value2);
+        $conditions[$field2] = $value2;
     }
     if ($field3) {
-        $conditions[$field3] = stripslashes_recursive($value3);
+        $conditions[$field3] = $value3;
     }
 
     return $DB->delete_records($table, $conditions);
@@ -367,13 +365,13 @@
 
     $conditions = array();
     if ($field1) {
-        $conditions[$field1] = stripslashes_recursive($value1);
+        $conditions[$field1] = $value1;
     }
     if ($field2) {
-        $conditions[$field2] = stripslashes_recursive($value2);
+        $conditions[$field2] = $value2;
     }
     if ($field3) {
-        $conditions[$field3] = stripslashes_recursive($value3);
+        $conditions[$field3] = $value3;
     }
 
     return $DB->get_field($table, $return, $conditions);
Index: lib/blocklib.php
===================================================================
RCS file: /cvsroot/moodle/moodle/lib/blocklib.php,v
retrieving revision 1.139
diff -u -r1.139 blocklib.php
--- lib/blocklib.php	4 Jun 2008 21:34:14 -0000	1.139
+++ lib/blocklib.php	9 Jun 2008 13:36:50 -0000
@@ -510,7 +510,7 @@
             // To this data, add anything the page itself needs to display
             $hiddendata = array_merge($hiddendata, $page->url_get_parameters());
 
-            if ($data = data_submitted(false)) {
+            if ($data = data_submitted()) {
                 $remove = array_keys($hiddendata);
                 foreach($remove as $item) {
                     unset($data->$item);
Index: lib/questionlib.php
===================================================================
RCS file: /cvsroot/moodle/moodle/lib/questionlib.php,v
retrieving revision 1.135
diff -u -r1.135 questionlib.php
--- lib/questionlib.php	9 Jun 2008 12:16:54 -0000	1.135
+++ lib/questionlib.php	9 Jun 2008 13:37:03 -0000
@@ -975,9 +975,9 @@
     global $QTYPES;
 
     // initialise response to the value in the answer field
-    $state->responses = array('' => addslashes($state->answer));
+    $state->responses = array('' => $state->answer);
     unset($state->answer);
-    $state->manualcomment = isset($state->manualcomment) ? addslashes($state->manualcomment) : '';
+    $state->manualcomment = isset($state->manualcomment) ? $state->manualcomment : '';
 
     // Set the changed field to false; any code which changes the
     // question session must set this to true and must increment
Index: lib/weblib.php
===================================================================
RCS file: /cvsroot/moodle/moodle/lib/weblib.php,v
retrieving revision 1.1081
diff -u -r1.1081 weblib.php
--- lib/weblib.php	6 Jun 2008 01:49:07 -0000	1.1081
+++ lib/weblib.php	9 Jun 2008 13:37:10 -0000
@@ -449,20 +449,14 @@
  *
  * Checks that submitted POST data exists and returns it as object.
  *
- * @param bool slashes TEMPORARY - false if strip magic quotes
  * @return mixed false or object
  */
-function data_submitted($slashes=true) {
+function data_submitted() {
 
     if (empty($_POST)) {
         return false;
     } else {
-        if ($slashes===false) {
-            $post = stripslashes_recursive($_POST); // temporary hack before magic quotes removal
-            return (object)$post;
-        } else {
-            return (object)$_POST;
-        }
+        return (object)$_POST;
     }
 }
 
@@ -540,41 +534,6 @@
 }
 
 /**
- * Recursive implementation of addslashes()
- *
- * This function will allow you to add the slashes from a variable.
- * If the variable is an array or object, slashes will be added
- * to the items (or properties) it contains, even if they are arrays
- * or objects themselves.
- *
- * @param mixed the variable to add slashes from
- * @return mixed
- */
-function addslashes_recursive($var) {
-    if (is_object($var)) {
-        $new_var = new object();
-        $properties = get_object_vars($var);
-        foreach($properties as $property => $value) {
-            $new_var->$property = addslashes_recursive($value);
-        }
-
-    } else if (is_array($var)) {
-        $new_var = array();
-        foreach($var as $property => $value) {
-            $new_var[$property] = addslashes_recursive($value);
-        }
-
-    } else if (is_string($var)) {
-        $new_var = addslashes($var);
-
-    } else { // nulls, integers, etc.
-        $new_var = $var;
-    }
-
-    return $new_var;
-}
-
-/**
  * Given some normal text this function will break up any
  * long words to a given size by inserting the given character
  *
@@ -1312,7 +1271,7 @@
     $pathinfo = explode($file, $string);
 
     if (!empty($pathinfo[1])) {
-        return addslashes($pathinfo[1]);
+        return $pathinfo[1];
     } else {
         return false;
     }
@@ -1811,10 +1770,6 @@
  * function that modifies the data! We do not know the origin of trusttext
  * in database, if it gets there in tweaked form we must not convert it
  * to supported form!!!
- *
- * Please be carefull not to use stripslashes on data from database
- * or twice stripslashes when processing data recieved from user.
- *
  * @param string $text text that may contain TRUSTTEXT marker
  * @return text without any TRUSTTEXT marker
  */
@@ -3834,7 +3789,7 @@
  */
 function print_heading_with_help($text, $helppage, $module='moodle', $icon='', $return=false) {
     $output = '<div class="heading-with-help">';
-    $output .= '<h2 class="main help">'.$icon.stripslashes_safe($text).'</h2>';
+    $output .= '<h2 class="main help">'.$icon.$text.'</h2>';
     $output .= helpbutton($helppage, $text, $module, true, false, '', true);
     $output .= '</div>';
 
@@ -3848,7 +3803,7 @@
 
 function print_heading_block($heading, $class='', $return=false) {
     //Accessibility: 'headingblock' is now H1, see theme/standard/styles_*.css: ??
-    $output = '<h2 class="headingblock header '.$class.'">'.stripslashes($heading).'</h2>';
+    $output = '<h2 class="headingblock header '.$class.'">'.$heading.'</h2>';
 
     if ($return) {
         return $output;
@@ -3916,7 +3871,6 @@
 function print_box($message, $classes='generalbox', $ids='', $return=false) {
 
     $output  = print_box_start($classes, $ids, true);
-    $output .= stripslashes_safe($message);
     $output .= print_box_end(true);
 
     if ($return) {
@@ -3977,7 +3931,6 @@
 function print_container($message, $clearfix=false, $classes='', $idbase='', $return=false) {
 
     $output  = print_container_start($clearfix, $classes, $idbase, true);
-    $output .= stripslashes_safe($message);
     $output .= print_container_end(true);
 
     if ($return) {
Index: lib/adminlib.php
===================================================================
RCS file: /cvsroot/moodle/moodle/lib/adminlib.php,v
retrieving revision 1.214
diff -u -r1.214 adminlib.php
--- lib/adminlib.php	6 Jun 2008 03:51:39 -0000	1.214
+++ lib/adminlib.php	9 Jun 2008 13:36:48 -0000
@@ -545,7 +545,7 @@
         return;
     }
     echo '<script>';
-    echo 'document.getElementById("text'.$thisbarid.'").innerHTML = "'.addslashes($donetext).'";'."\n";
+    echo 'document.getElementById("text'.$thisbarid.'").innerHTML = "'.addslashes_js($donetext).'";'."\n";
     echo 'document.getElementById("slider'.$thisbarid.'").style.width = \''.$width.'px\';'."\n";
     echo '</script>';
 }
@@ -1728,7 +1728,7 @@
             return true;
 
         } else {
-            $cleaned = stripslashes(clean_param(addslashes($data), $this->paramtype));
+            $cleaned = clean_param($data, $this->paramtype);
             if ("$data" == "$cleaned") { // implicit conversion to string is needed to do exact comparison
                 return true;
             } else {
@@ -2580,7 +2580,7 @@
     }
 
     function validate($data) {
-        $cleaned = stripslashes(clean_param(addslashes($data), PARAM_MULTILANG));
+        $cleaned = clean_param($data, PARAM_MULTILANG);
         if ($cleaned === '') {
             return get_string('required');
         }
Index: lib/formslib.php
===================================================================
RCS file: /cvsroot/moodle/moodle/lib/formslib.php,v
retrieving revision 1.145
diff -u -r1.145 formslib.php
--- lib/formslib.php	1 Jun 2008 17:53:26 -0000	1.145
+++ lib/formslib.php	9 Jun 2008 13:36:54 -0000
@@ -244,15 +244,16 @@
      * form definition (new entry form); this function is used to load in data where values
      * already exist and data is being edited (edit entry form).
      *
+     * note: $slashed param removed
+     *
      * @param mixed $default_values object or array of default values
      * @param bool $slased true if magic quotes applied to data values
      */
-    function set_data($default_values, $slashed=false) {
+    function set_data($default_values) {
         if (is_object($default_values)) {
             $default_values = (array)$default_values;
         }
-        $filter = $slashed ? 'stripslashes' : NULL;
-        $this->_form->setDefaults($default_values, $filter);
+        $this->_form->setDefaults($default_values);
     }
 
     /**
@@ -369,15 +370,16 @@
     /**
      * Return submitted data if properly submitted or returns NULL if validation fails or
      * if there is no submitted data.
+     * 
+     * note: $slashed param removed
      *
-     * @param bool $slashed true means return data with addslashes applied
      * @return object submitted data; NULL if not valid or not submitted
      */
-    function get_data($slashed=true) {
+    function get_data() {
         $mform =& $this->_form;
 
         if ($this->is_submitted() and $this->is_validated()) {
-            $data = $mform->exportValues(null, $slashed);
+            $data = $mform->exportValues();
             unset($data['sesskey']); // we do not need to return sesskey
             unset($data['_qf__'.$this->_formname]);   // we do not need the submission marker too
             if (empty($data)) {
@@ -392,15 +394,15 @@
 
     /**
      * Return submitted data without validation or NULL if there is no submitted data.
+     * note: $slashed param removed
      *
-     * @param bool $slashed true means return data with addslashes applied
      * @return object submitted data; NULL if not submitted
      */
-    function get_submitted_data($slashed=true) {
+    function get_submitted_data() {
         $mform =& $this->_form;
 
         if ($this->is_submitted()) {
-            $data = $mform->exportValues(null, $slashed);
+            $data = $mform->exportValues();
             unset($data['sesskey']); // we do not need to return sesskey
             unset($data['_qf__'.$this->_formname]);   // we do not need the submission marker too
             if (empty($data)) {
@@ -976,19 +978,13 @@
                     $submission[$key] = clean_param($s, $this->_types[$key]);
                 }
             }
-            $this->_submitValues = $this->_recursiveFilter('stripslashes', $submission);
+            $this->_submitValues = $submission;
             $this->_flagSubmitted = true;
         }
 
         if (empty($files)) {
             $this->_submitFiles = array();
         } else {
-            if (1 == get_magic_quotes_gpc()) {
-                foreach (array_keys($files) as $elname) {
-                    // dangerous characters in filenames are cleaned later in upload_manager
-                    $files[$elname]['name'] = stripslashes($files[$elname]['name']);
-                }
-            }
             $this->_submitFiles = $files;
             $this->_flagSubmitted = true;
         }
@@ -1011,15 +1007,15 @@
      * Initializes a default form value. Used to specify the default for a new entry where
      * no data is loaded in using moodleform::set_data()
      *
+     * note: $slashed param removed
+     *
      * @param     string   $elementname        element name
      * @param     mixed    $values             values for that element name
-     * @param     bool     $slashed            the default value is slashed
      * @access    public
      * @return    void
      */
-    function setDefault($elementName, $defaultValue, $slashed=false){
-        $filter = $slashed ? 'stripslashes' : NULL;
-        $this->setDefaults(array($elementName=>$defaultValue), $filter);
+    function setDefault($elementName, $defaultValue){
+        $this->setDefaults(array($elementName=>$defaultValue));
     } // end func setDefault
     /**
      * Add an array of buttons to the form
@@ -1060,7 +1056,7 @@
         }
     }
 
-    function exportValues($elementList= null, $addslashes=true){
+    function exportValues($elementList = null){
         $unfiltered = array();
         if (null === $elementList) {
             // iterate over all elements, calling their exportValue() methods
@@ -1090,11 +1086,7 @@
             }
         }
 
-        if ($addslashes){
-            return $this->_recursiveFilter('addslashes', $unfiltered);
-        } else {
-            return $unfiltered;
-        }
+        return $unfiltered;
     }
     /**
      * Adds a validation rule for the given field
Index: lib/recaptchalib.php
===================================================================
RCS file: /cvsroot/moodle/moodle/lib/recaptchalib.php,v
retrieving revision 1.5
diff -u -r1.5 recaptchalib.php
--- lib/recaptchalib.php	31 Mar 2008 12:13:46 -0000	1.5
+++ lib/recaptchalib.php	9 Jun 2008 13:37:03 -0000
@@ -47,7 +47,7 @@
 function _recaptcha_qsencode ($data) {
         $req = "";
         foreach ( $data as $key => $value )
-                $req .= $key . '=' . urlencode( stripslashes($value) ) . '&';
+                $req .= $key . '=' . urlencode( $value ) . '&';
 
         // Cut the last '&'
         $req=substr($req,0,strlen($req)-1);
Index: lib/setup.php
===================================================================
RCS file: /cvsroot/moodle/moodle/lib/setup.php,v
retrieving revision 1.234
diff -u -r1.234 setup.php
--- lib/setup.php	19 May 2008 18:02:34 -0000	1.234
+++ lib/setup.php	9 Jun 2008 13:37:04 -0000
@@ -385,36 +385,36 @@
              . "cannot work with magic_quotes_gpc. Please disable "
              . "magic_quotes_gpc.");
     }
-/// A hack to get around magic_quotes_gpc being turned off
-/// It is strongly recommended to enable "magic_quotes_gpc"!
-    if (!ini_get_bool('magic_quotes_gpc') && !defined('MOODLE_SANE_INPUT') ) {
-        function addslashes_deep($value) {
+/// A hack to get around magic_quotes_gpc being turned on
+/// It is strongly recommended to disable "magic_quotes_gpc"!
+    if (ini_get_bool('magic_quotes_gpc')) {
+        function stripslashes_deep($value) {
             $value = is_array($value) ?
-                    array_map('addslashes_deep', $value) :
-                    addslashes($value);
+                    array_map('stripslashes_deep', $value) :
+                    stripslashes($value);
             return $value;
         }
-        $_POST = array_map('addslashes_deep', $_POST);
-        $_GET = array_map('addslashes_deep', $_GET);
-        $_COOKIE = array_map('addslashes_deep', $_COOKIE);
-        $_REQUEST = array_map('addslashes_deep', $_REQUEST);
+        $_POST = array_map('stripslashes_deep', $_POST);
+        $_GET = array_map('stripslashes_deep', $_GET);
+        $_COOKIE = array_map('stripslashes_deep', $_COOKIE);
+        $_REQUEST = array_map('stripslashes_deep', $_REQUEST);
         if (!empty($_SERVER['REQUEST_URI'])) {
-            $_SERVER['REQUEST_URI'] = addslashes($_SERVER['REQUEST_URI']);
+            $_SERVER['REQUEST_URI'] = stripslashes($_SERVER['REQUEST_URI']);
         }
         if (!empty($_SERVER['QUERY_STRING'])) {
-            $_SERVER['QUERY_STRING'] = addslashes($_SERVER['QUERY_STRING']);
+            $_SERVER['QUERY_STRING'] = stripslashes($_SERVER['QUERY_STRING']);
         }
         if (!empty($_SERVER['HTTP_REFERER'])) {
-            $_SERVER['HTTP_REFERER'] = addslashes($_SERVER['HTTP_REFERER']);
+            $_SERVER['HTTP_REFERER'] = stripslashes($_SERVER['HTTP_REFERER']);
         }
        if (!empty($_SERVER['PATH_INFO'])) {
-            $_SERVER['PATH_INFO'] = addslashes($_SERVER['PATH_INFO']);
+            $_SERVER['PATH_INFO'] = stripslashes($_SERVER['PATH_INFO']);
         }
         if (!empty($_SERVER['PHP_SELF'])) {
-            $_SERVER['PHP_SELF'] = addslashes($_SERVER['PHP_SELF']);
+            $_SERVER['PHP_SELF'] = stripslashes($_SERVER['PHP_SELF']);
         }
         if (!empty($_SERVER['PATH_TRANSLATED'])) {
-            $_SERVER['PATH_TRANSLATED'] = addslashes($_SERVER['PATH_TRANSLATED']);
+            $_SERVER['PATH_TRANSLATED'] = stripslashes($_SERVER['PATH_TRANSLATED']);
         }
     }
 
Index: lib/searchlib.php
===================================================================
RCS file: /cvsroot/moodle/moodle/lib/searchlib.php,v
retrieving revision 1.15
diff -u -r1.15 searchlib.php
--- lib/searchlib.php	2 Jun 2008 21:56:06 -0000	1.15
+++ lib/searchlib.php	9 Jun 2008 13:37:04 -0000
@@ -29,7 +29,7 @@
   // Need to think about this some more. 
 
   function sanitize($userstring){
-    return htmlspecialchars(addslashes($userstring));
+    return htmlspecialchars($userstring);
   }
   function getValue(){  
     return $this->value;
Index: lib/deprecatedlib.php
===================================================================
RCS file: /cvsroot/moodle/moodle/lib/deprecatedlib.php,v
retrieving revision 1.87
diff -u -r1.87 deprecatedlib.php
--- lib/deprecatedlib.php	1 Jun 2008 13:20:02 -0000	1.87
+++ lib/deprecatedlib.php	9 Jun 2008 13:36:52 -0000
@@ -222,7 +222,7 @@
 function print_simple_box($message, $align='', $width='', $color='', $padding=5, $class='generalbox', $id='', $return=false) {
     $output = '';
     $output .= print_simple_box_start($align, $width, $color, $padding, $class, $id, true);
-    $output .= stripslashes_safe($message);
+    $output .= $message;
     $output .= print_simple_box_end(true);
 
     if ($return) {
@@ -496,4 +496,16 @@
 
     die;
 }
+
+/// removed functions
+function addslashes_object( $dataobject ) {
+    error('addslashes() not available anymore');
+}
+
+function addslashes_recursive($var) {
+    error('addslashes_recursive() not available anymore');
+}
+
+
+
 ?>
Index: lib/moodlelib.php
===================================================================
RCS file: /cvsroot/moodle/moodle/lib/moodlelib.php,v
retrieving revision 1.1056
diff -u -r1.1056 moodlelib.php
--- lib/moodlelib.php	5 Jun 2008 20:35:28 -0000	1.1056
+++ lib/moodlelib.php	9 Jun 2008 13:37:00 -0000
@@ -197,7 +197,6 @@
 
 /**
  * PARAM_CLEANHTML - cleans submitted HTML code and removes slashes
- * note: do not forget to addslashes() before storing into database!
  */
 define('PARAM_CLEANHTML',0x1000);
 
@@ -403,12 +402,9 @@
             if (is_numeric($param)) {
                 return $param;
             }
-            $param = stripslashes($param);   // Needed for kses to work fine
-            $param = clean_text($param);     // Sweep for scripts, etc
-            return addslashes($param);       // Restore original request parameter slashes
+            return clean_text($param);     // Sweep for scripts, etc
 
         case PARAM_CLEANHTML:    // prepare html fragment for display, do not store it into db!!
-            $param = stripslashes($param);   // Remove any slashes
             $param = clean_text($param);     // Sweep for scripts, etc
             return trim($param);
 
Index: admin/xmldb/actions/edit_table_save/edit_table_save.class.php
===================================================================
RCS file: /cvsroot/moodle/moodle/admin/xmldb/actions/edit_table_save/edit_table_save.class.php,v
retrieving revision 1.10
diff -u -r1.10 edit_table_save.class.php
--- admin/xmldb/actions/edit_table_save/edit_table_save.class.php	20 May 2008 23:24:40 -0000	1.10
+++ admin/xmldb/actions/edit_table_save/edit_table_save.class.php	9 Jun 2008 13:36:11 -0000
@@ -65,18 +65,18 @@
 
     /// Do the job, setting result as needed
 
-        if (!data_submitted('nomatch')) { ///Basic prevention
+        if (!data_submitted()) { ///Basic prevention
             print_error('wrongcall', 'error');
         }
 
     /// Get parameters
         $dirpath = required_param('dir', PARAM_PATH);
-        $dirpath = $CFG->dirroot . stripslashes_safe($dirpath);
+        $dirpath = $CFG->dirroot . $dirpath;
 
         $tableparam = strtolower(required_param('table', PARAM_PATH));
         $name = substr(trim(strtolower(required_param('name', PARAM_PATH))),0,28);
         $comment = required_param('comment', PARAM_CLEAN);
-        $comment = stripslashes_safe($comment);
+        $comment = $comment;
 
         $editeddir =& $XMLDB->editeddirs[$dirpath];
         $structure =& $editeddir->xml_file->getStructure();
Index: auth/db/auth.php
===================================================================
RCS file: /cvsroot/moodle/moodle/auth/db/auth.php,v
retrieving revision 1.32
diff -u -r1.32 auth.php
--- auth/db/auth.php	7 Jun 2008 15:41:25 -0000	1.32
+++ auth/db/auth.php	9 Jun 2008 13:36:17 -0000
@@ -229,7 +229,7 @@
 
 /// list external users
         $userlist = $this->get_userlist();
-        $quoteduserlist = implode("', '", addslashes_recursive($userlist));
+        $quoteduserlist = implode("', '", $userlist);
         $quoteduserlist = "'$quoteduserlist'";
 
 /// delete obsolete internal users
@@ -667,7 +667,6 @@
             $config->changepasswordurl = '';
         }
 
-        $config = stripslashes_recursive($config);
         // save settings
         set_config('host',          $config->host,          'auth/db');
         set_config('type',          $config->type,          'auth/db');
Index: mod/feedback/import.php
===================================================================
RCS file: /cvsroot/moodle/moodle/mod/feedback/import.php,v
retrieving revision 1.3
diff -u -r1.3 import.php
--- mod/feedback/import.php	7 Jun 2008 22:22:07 -0000	1.3
+++ mod/feedback/import.php	9 Jun 2008 13:37:26 -0000
@@ -16,7 +16,7 @@
     $choosefile = optional_param('choosefile', false, PARAM_PATH);
     $action = optional_param('action', false, PARAM_ALPHA);
 
-    if(($formdata = data_submitted('nomatch')) AND !confirm_sesskey()) {
+    if(($formdata = data_submitted()) AND !confirm_sesskey()) {
         error('no sesskey defined');
     }
     
Index: mod/feedback/show_entries.php
===================================================================
RCS file: /cvsroot/moodle/moodle/mod/feedback/show_entries.php,v
retrieving revision 1.7
diff -u -r1.7 show_entries.php
--- mod/feedback/show_entries.php	7 Jun 2008 22:22:07 -0000	1.7
+++ mod/feedback/show_entries.php	9 Jun 2008 13:37:26 -0000
@@ -64,7 +64,7 @@
 
     require_login($course->id, true, $cm);
     
-    if(($formdata = data_submitted('nomatch')) AND !confirm_sesskey()) {
+    if(($formdata = data_submitted()) AND !confirm_sesskey()) {
         error('no sesskey defined');
     }
     
Index: mod/feedback/mapcourse.php
===================================================================
RCS file: /cvsroot/moodle/moodle/mod/feedback/mapcourse.php,v
retrieving revision 1.4
diff -u -r1.4 mapcourse.php
--- mod/feedback/mapcourse.php	7 Jun 2008 22:22:06 -0000	1.4
+++ mod/feedback/mapcourse.php	9 Jun 2008 13:37:26 -0000
@@ -17,7 +17,7 @@
     $coursefilter = optional_param('coursefilter', '', PARAM_INT);
     $courseid = optional_param('courseid', false, PARAM_INT);
     
-    if(($formdata = data_submitted('nomatch')) AND !confirm_sesskey()) {
+    if(($formdata = data_submitted()) AND !confirm_sesskey()) {
         error('no sesskey defined');
     }
     
Index: mod/feedback/edit.php
===================================================================
RCS file: /cvsroot/moodle/moodle/mod/feedback/edit.php,v
retrieving revision 1.5
diff -u -r1.5 edit.php
--- mod/feedback/edit.php	7 Jun 2008 22:22:07 -0000	1.5
+++ mod/feedback/edit.php	9 Jun 2008 13:37:25 -0000
@@ -14,7 +14,7 @@
 
     $id = required_param('id', PARAM_INT);
 
-    if(($formdata = data_submitted('nomatch')) AND !confirm_sesskey()) {
+    if(($formdata = data_submitted()) AND !confirm_sesskey()) {
         error('no sesskey defined');
     }
     
Index: mod/feedback/edit_item.php
===================================================================
RCS file: /cvsroot/moodle/moodle/mod/feedback/edit_item.php,v
retrieving revision 1.8
diff -u -r1.8 edit_item.php
--- mod/feedback/edit_item.php	7 Jun 2008 22:22:07 -0000	1.8
+++ mod/feedback/edit_item.php	9 Jun 2008 13:37:25 -0000
@@ -21,7 +21,7 @@
     $usehtmleditor = can_use_html_editor(); 
 
 
-    if(($formdata = data_submitted('nomatch')) AND !confirm_sesskey()) {
+    if(($formdata = data_submitted()) AND !confirm_sesskey()) {
         error('no sesskey defined');
     }
 
Index: mod/feedback/print.php
===================================================================
RCS file: /cvsroot/moodle/moodle/mod/feedback/print.php,v
retrieving revision 1.4
diff -u -r1.4 print.php
--- mod/feedback/print.php	7 Jun 2008 22:22:06 -0000	1.4
+++ mod/feedback/print.php	9 Jun 2008 13:37:26 -0000
@@ -13,7 +13,7 @@
 
     $id = required_param('id', PARAM_INT); 
 
-    $formdata = data_submitted('nomatch');
+    $formdata = data_submitted();
  
     if ($id) {
         if (! $cm = get_coursemodule_from_id('feedback', $id)) {
Index: mod/feedback/complete.php
===================================================================
RCS file: /cvsroot/moodle/moodle/mod/feedback/complete.php,v
retrieving revision 1.7
diff -u -r1.7 complete.php
--- mod/feedback/complete.php	7 Jun 2008 22:22:06 -0000	1.7
+++ mod/feedback/complete.php	9 Jun 2008 13:37:24 -0000
@@ -23,7 +23,7 @@
 
     $highlightrequired = false;
 
-    if(($formdata = data_submitted('nomatch')) AND !confirm_sesskey()) {
+    if(($formdata = data_submitted()) AND !confirm_sesskey()) {
         error('no sesskey defined');
     }
 
@@ -255,7 +255,7 @@
             if($feedback->page_after_submit) {
                 // print_simple_box_start('center', '75%');
                 print_box_start('generalbox boxaligncenter boxwidthwide');
-                echo format_text(stripslashes_safe($feedback->page_after_submit));
+                echo format_text($feedback->page_after_submit);
                 // print_simple_box_end();
                 print_box_end();
             } else {
Index: mod/feedback/analysis_to_excel.php
===================================================================
RCS file: /cvsroot/moodle/moodle/mod/feedback/analysis_to_excel.php,v
retrieving revision 1.4
diff -u -r1.4 analysis_to_excel.php
--- mod/feedback/analysis_to_excel.php	7 Jun 2008 22:22:07 -0000	1.4
+++ mod/feedback/analysis_to_excel.php	9 Jun 2008 13:37:24 -0000
@@ -14,7 +14,7 @@
  
     $id = required_param('id', PARAM_INT);  //the POST dominated the GET
     
-    $formdata = data_submitted('nomatch');
+    $formdata = data_submitted();
     
     if ($id) {
         if (! $cm = get_coursemodule_from_id('feedback', $id)) {
@@ -177,7 +177,7 @@
         
         foreach($items as $item) {
             $worksheet->setFormat('<l><f><ru2>');
-            $worksheet->write_string($rowOffset, $colOffset, stripslashes_safe($item->name));
+            $worksheet->write_string($rowOffset, $colOffset, $item->name);
             $colOffset++;
         }
 
Index: mod/feedback/complete_guest.php
===================================================================
RCS file: /cvsroot/moodle/moodle/mod/feedback/complete_guest.php,v
retrieving revision 1.6
diff -u -r1.6 complete_guest.php
--- mod/feedback/complete_guest.php	7 Jun 2008 22:22:06 -0000	1.6
+++ mod/feedback/complete_guest.php	9 Jun 2008 13:37:24 -0000
@@ -22,7 +22,7 @@
 
     $highlightrequired = false;
 
-    if(($formdata = data_submitted('nomatch')) AND !confirm_sesskey()) {
+    if(($formdata = data_submitted()) AND !confirm_sesskey()) {
         error('no sesskey defined');
     }
     
@@ -230,7 +230,7 @@
             if($feedback->page_after_submit) {
                 // print_simple_box_start('center', '75%');
                 print_box_start('generalbox boxaligncenter boxwidthwide');
-                echo format_text(stripslashes_safe($feedback->page_after_submit));
+                echo format_text($feedback->page_after_submit);
                 // print_simple_box_end();
                 print_box_end();
             } else {
Index: mod/feedback/show_entries_anonym.php
===================================================================
RCS file: /cvsroot/moodle/moodle/mod/feedback/show_entries_anonym.php,v
retrieving revision 1.4
diff -u -r1.4 show_entries_anonym.php
--- mod/feedback/show_entries_anonym.php	7 Jun 2008 22:22:07 -0000	1.4
+++ mod/feedback/show_entries_anonym.php	9 Jun 2008 13:37:27 -0000
@@ -17,7 +17,7 @@
     $id = required_param('id', PARAM_INT); 
     $userid = optional_param('userid', false, PARAM_INT);
     
-    if(($formdata = data_submitted('nomatch')) AND !confirm_sesskey()) {
+    if(($formdata = data_submitted()) AND !confirm_sesskey()) {
         error('no sesskey defined');
     }
 
Index: mod/feedback/delete_template.php
===================================================================
RCS file: /cvsroot/moodle/moodle/mod/feedback/delete_template.php,v
retrieving revision 1.4
diff -u -r1.4 delete_template.php
--- mod/feedback/delete_template.php	7 Jun 2008 22:22:06 -0000	1.4
+++ mod/feedback/delete_template.php	9 Jun 2008 13:37:24 -0000
@@ -19,9 +19,9 @@
     $canceldelete = optional_param('canceldelete', false, PARAM_INT);
     $shoulddelete = optional_param('shoulddelete', false, PARAM_INT);
     $deletetempl = optional_param('deletetempl', false, PARAM_INT);
-    // $formdata = data_submitted('nomatch');
+    // $formdata = data_submitted();
     
-    if(($formdata = data_submitted('nomatch')) AND !confirm_sesskey()) {
+    if(($formdata = data_submitted()) AND !confirm_sesskey()) {
         error('no sesskey defined');
     }
     
Index: admin/xmldb/actions/view_field_xml/view_field_xml.class.php
===================================================================
RCS file: /cvsroot/moodle/moodle/admin/xmldb/actions/view_field_xml/view_field_xml.class.php,v
retrieving revision 1.4
diff -u -r1.4 view_field_xml.class.php
--- admin/xmldb/actions/view_field_xml/view_field_xml.class.php	10 Oct 2007 05:25:21 -0000	1.4
+++ admin/xmldb/actions/view_field_xml/view_field_xml.class.php	9 Jun 2008 13:36:14 -0000
@@ -66,7 +66,7 @@
         $select = required_param('select', PARAM_ALPHA); //original/edited
     /// Get the dir containing the file
         $dirpath = required_param('dir', PARAM_PATH);
-        $dirpath = $CFG->dirroot . stripslashes_safe($dirpath);
+        $dirpath = $CFG->dirroot . $dirpath;
 
     /// Get the correct dir
         if ($select == 'original') {
Index: grade/edit/tree/outcomeitem.php
===================================================================
RCS file: /cvsroot/moodle/moodle/grade/edit/tree/outcomeitem.php,v
retrieving revision 1.21
diff -u -r1.21 outcomeitem.php
--- grade/edit/tree/outcomeitem.php	3 Jun 2008 16:10:59 -0000	1.21
+++ grade/edit/tree/outcomeitem.php	9 Jun 2008 13:36:40 -0000
@@ -100,7 +100,7 @@
 $mform->set_data($item);
 
 
-if ($data = $mform->get_data(false)) {
+if ($data = $mform->get_data()) {
 
     if (!isset($data->aggregationcoef)) {
         $data->aggregationcoef = 0;
Index: grade/edit/tree/item.php
===================================================================
RCS file: /cvsroot/moodle/moodle/grade/edit/tree/item.php,v
retrieving revision 1.19
diff -u -r1.19 item.php
--- grade/edit/tree/item.php	3 Jun 2008 16:10:58 -0000	1.19
+++ grade/edit/tree/item.php	9 Jun 2008 13:36:40 -0000
@@ -101,7 +101,7 @@
 
 $mform->set_data($item);
 
-if ($data = $mform->get_data(false)) {
+if ($data = $mform->get_data()) {
 
     if (!isset($data->aggregationcoef)) {
         $data->aggregationcoef = 0;
Index: grade/edit/tree/grade.php
===================================================================
RCS file: /cvsroot/moodle/moodle/grade/edit/tree/grade.php,v
retrieving revision 1.24
diff -u -r1.24 grade.php
--- grade/edit/tree/grade.php	3 Jun 2008 16:10:58 -0000	1.24
+++ grade/edit/tree/grade.php	9 Jun 2008 13:36:40 -0000
@@ -153,7 +153,7 @@
     redirect($returnurl);
 
 // form processing
-} else if ($data = $mform->get_data(false)) {
+} else if ($data = $mform->get_data()) {
     $old_grade_grade = new grade_grade(array('userid'=>$data->userid, 'itemid'=>$grade_item->id), true); //might not exist yet
 
     // fix no grade for scales
Index: grade/edit/tree/calculation.php
===================================================================
RCS file: /cvsroot/moodle/moodle/grade/edit/tree/calculation.php,v
retrieving revision 1.18
diff -u -r1.18 calculation.php
--- grade/edit/tree/calculation.php	3 Jun 2008 16:10:58 -0000	1.18
+++ grade/edit/tree/calculation.php	9 Jun 2008 13:36:39 -0000
@@ -67,7 +67,7 @@
 
 $errors = array();
 
-if ($data = $mform->get_data(false)) {
+if ($data = $mform->get_data()) {
     $calculation = calc_formula::unlocalize($data->calculation);
     $grade_item->set_calculation($calculation);
 
@@ -88,7 +88,7 @@
                 continue;
             }
 
-            if (empty($gi->idnumber) and !$gi->add_idnumber(stripslashes($idnumbers[$gi->id]))) {
+            if (empty($gi->idnumber) and !$gi->add_idnumber($idnumbers[$gi->id])) {
                 $errors[$giid] = get_string('error');
                 continue;
             }
Index: grade/edit/tree/category.php
===================================================================
RCS file: /cvsroot/moodle/moodle/grade/edit/tree/category.php,v
retrieving revision 1.13
diff -u -r1.13 category.php
--- grade/edit/tree/category.php	3 Jun 2008 16:10:58 -0000	1.13
+++ grade/edit/tree/category.php	9 Jun 2008 13:36:39 -0000
@@ -74,7 +74,7 @@
 if ($mform->is_cancelled()) {
     redirect($returnurl);
 
-} else if ($data = $mform->get_data(false)) {
+} else if ($data = $mform->get_data()) {
     // If no fullname is entered for a course category, put ? in the DB
     if (!isset($data->fullname) || $data->fullname == '') {
         $data->fullname = '?';
Index: lib/dml/oci8po_adodb_moodle_database.php
===================================================================
RCS file: /cvsroot/moodle/moodle/lib/dml/oci8po_adodb_moodle_database.php,v
retrieving revision 1.10
diff -u -r1.10 oci8po_adodb_moodle_database.php
--- lib/dml/oci8po_adodb_moodle_database.php	26 May 2008 00:39:24 -0000	1.10
+++ lib/dml/oci8po_adodb_moodle_database.php	9 Jun 2008 13:37:11 -0000
@@ -57,11 +57,6 @@
         /// DB using DOTS. Manually introduced floats (if using other characters) must be
         /// converted back to DOTs (like gradebook does)
         $this->db->Execute("ALTER SESSION SET NLS_NUMERIC_CHARACTERS='.,'");
-        /// Enable sybase quotes, so addslashes and stripslashes will use "'"
-        ini_set('magic_quotes_sybase', '1');
-        /// NOTE: Not 100% useful because GPC has been addslashed with the setting off
-        ///       so IT'S MANDATORY TO ENABLE THIS UNDER php.ini or .htaccess for this DB
-        ///       or to turn off magic_quotes to allow Moodle to do it properly
 
         return true;
     }
Index: lib/dml/mssql_adodb_moodle_database.php
===================================================================
RCS file: /cvsroot/moodle/moodle/lib/dml/mssql_adodb_moodle_database.php,v
retrieving revision 1.8
diff -u -r1.8 mssql_adodb_moodle_database.php
--- lib/dml/mssql_adodb_moodle_database.php	7 Jun 2008 14:41:01 -0000	1.8
+++ lib/dml/mssql_adodb_moodle_database.php	9 Jun 2008 13:37:11 -0000
@@ -48,11 +48,6 @@
         /// Force ANSI nulls so the NULL check was done by IS NULL and NOT IS NULL
         /// instead of equal(=) and distinct(<>) simbols
             $this->db->Execute('SET ANSI_NULLS ON');
-        /// Enable sybase quotes, so addslashes and stripslashes will use "'"
-            ini_set('magic_quotes_sybase', '1');
-        /// NOTE: Not 100% useful because GPC has been addslashed with the setting off
-        ///       so IT'S MANDATORY TO CHANGE THIS UNDER php.ini or .htaccess for this DB
-        ///       or to turn off magic_quotes to allow Moodle to do it properly
 
         return true;
     }
Index: admin/roles/manage.php
===================================================================
RCS file: /cvsroot/moodle/moodle/admin/roles/manage.php,v
retrieving revision 1.60
diff -u -r1.60 manage.php
--- admin/roles/manage.php	2 Jun 2008 21:39:25 -0000	1.60
+++ admin/roles/manage.php	9 Jun 2008 13:36:06 -0000
@@ -14,9 +14,6 @@
     $confirm     = optional_param('confirm', 0, PARAM_BOOL);
     $cancel      = optional_param('cancel', 0, PARAM_BOOL);
 
-    $name        = stripslashes($name);
-    $description = stripslashes($description);
-
     $sitecontext = get_context_instance(CONTEXT_SYSTEM);
 
     require_capability('moodle/role:manage', $sitecontext);
@@ -56,7 +53,7 @@
 /// form processing, editing a role, adding a role, deleting a role etc.
     switch ($action) {
         case 'add':
-            if ($data = data_submitted(false) and confirm_sesskey()) {
+            if ($data = data_submitted() and confirm_sesskey()) {
 
                 $shortname = moodle_strtolower(clean_param(clean_filename($shortname), PARAM_SAFEDIR)); // only lowercase safe ASCII characters
                 $legacytype = required_param('legacytype', PARAM_RAW);
@@ -133,7 +130,7 @@
             break;
 
         case 'edit':
-            if ($data = data_submitted(false) and confirm_sesskey()) {
+            if ($data = data_submitted() and confirm_sesskey()) {
 
                 $shortname = moodle_strtolower(clean_param(clean_filename($shortname), PARAM_SAFEDIR)); // only lowercase safe ASCII characters
                 $legacytype = required_param('legacytype', PARAM_RAW);
Index: admin/roles/override.php
===================================================================
RCS file: /cvsroot/moodle/moodle/admin/roles/override.php,v
retrieving revision 1.50
diff -u -r1.50 override.php
--- admin/roles/override.php	2 Jun 2008 21:39:25 -0000	1.50
+++ admin/roles/override.php	9 Jun 2008 13:36:06 -0000
@@ -75,7 +75,7 @@
     $capabilities = fetch_context_capabilities($context);
 
 /// Process incoming role override
-    if ($data = data_submitted(false) and $roleid and confirm_sesskey()) {
+    if ($data = data_submitted() and $roleid and confirm_sesskey()) {
         $allowed_values = array(CAP_INHERIT, CAP_ALLOW, CAP_PREVENT, CAP_PROHIBIT);
 
         $localoverrides = $DB->get_records_select('role_capabilities', "roleid = ? AND contextid = ?", array($roleid, $context->id), 
Index: admin/roles/allowoverride.php
===================================================================
RCS file: /cvsroot/moodle/moodle/admin/roles/allowoverride.php,v
retrieving revision 1.15
diff -u -r1.15 allowoverride.php
--- admin/roles/allowoverride.php	31 May 2008 10:30:30 -0000	1.15
+++ admin/roles/allowoverride.php	9 Jun 2008 13:36:05 -0000
@@ -20,7 +20,7 @@
 
     $roles = get_all_roles();
 
-    if ($grant = data_submitted(false)) {
+    if ($grant = data_submitted()) {
 
         foreach ($grant as $grole => $val) {
             if ($grole == 'dummy') {
Index: grade/edit/settings/index.php
===================================================================
RCS file: /cvsroot/moodle/moodle/grade/edit/settings/index.php,v
retrieving revision 1.6
diff -u -r1.6 index.php
--- grade/edit/settings/index.php	3 Jun 2008 16:11:00 -0000	1.6
+++ grade/edit/settings/index.php	9 Jun 2008 13:36:39 -0000
@@ -56,7 +56,7 @@
 if ($mform->is_cancelled()) {
     redirect($returnurl);
 
-} else if ($data = $mform->get_data(false)) {
+} else if ($data = $mform->get_data()) {
     $data = (array)$data;
     $general = array('displaytype', 'decimalpoints', 'aggregationposition');
     foreach ($data as $key=>$value) {
Index: mod/assignment/lib.php
===================================================================
RCS file: /cvsroot/moodle/moodle/mod/assignment/lib.php,v
retrieving revision 1.328
diff -u -r1.328 lib.php
--- mod/assignment/lib.php	5 Jun 2008 13:12:00 -0000	1.328
+++ mod/assignment/lib.php	9 Jun 2008 13:37:20 -0000
@@ -1376,7 +1376,7 @@
         global $CFG, $USER;
         require_once($CFG->libdir.'/gradelib.php');
 
-        if (!$feedback = data_submitted(false)) {      // No incoming data?
+        if (!$feedback = data_submitted()) {      // No incoming data?
             return false;
         }
 
@@ -1444,7 +1444,7 @@
 
         require_once($CFG->libdir.'/gradelib.php');
 
-        if (!$formdata = data_submitted(false)) {
+        if (!$formdata = data_submitted()) {
             return;
         }
 
Index: admin/xmldb/actions/edit_xml_file_save/edit_xml_file_save.class.php
===================================================================
RCS file: /cvsroot/moodle/moodle/admin/xmldb/actions/edit_xml_file_save/edit_xml_file_save.class.php,v
retrieving revision 1.6
diff -u -r1.6 edit_xml_file_save.class.php
--- admin/xmldb/actions/edit_xml_file_save/edit_xml_file_save.class.php	11 Apr 2008 07:49:07 -0000	1.6
+++ admin/xmldb/actions/edit_xml_file_save/edit_xml_file_save.class.php	9 Jun 2008 13:36:11 -0000
@@ -61,16 +61,16 @@
 
     /// Do the job, setting result as needed
 
-        if (!data_submitted('nomatch')) { ///Basic prevention
+        if (!data_submitted()) { ///Basic prevention
             print_error('wrongcall', 'error');
         }
 
     /// Get parameters
         $dirpath = required_param('dir', PARAM_PATH);
-        $dirpath = $CFG->dirroot . stripslashes_safe($dirpath);
+        $dirpath = $CFG->dirroot . $dirpath;
 
         $comment = required_param('comment', PARAM_CLEAN);
-        $comment = stripslashes_safe($comment);
+        $comment = $comment;
 
     /// Set comment and recalculate hash
         $editeddir =& $XMLDB->editeddirs[$dirpath];
Index: admin/user/user_bulk_message.php
===================================================================
RCS file: /cvsroot/moodle/moodle/admin/user/user_bulk_message.php,v
retrieving revision 1.6
diff -u -r1.6 user_bulk_message.php
--- admin/user/user_bulk_message.php	31 May 2008 09:50:46 -0000	1.6
+++ admin/user/user_bulk_message.php	9 Jun 2008 13:36:07 -0000
@@ -43,7 +43,7 @@
 if ($msgform->is_cancelled()) {
     redirect($return);
 
-} else if ($formdata = $msgform->get_data(false)) {
+} else if ($formdata = $msgform->get_data()) {
     $options = new object();
     $options->para     = false;
     $options->newlines = true;
Index: admin/user/user_bulk.php
===================================================================
RCS file: /cvsroot/moodle/moodle/admin/user/user_bulk.php,v
retrieving revision 1.8
diff -u -r1.8 user_bulk.php
--- admin/user/user_bulk.php	5 Feb 2008 15:24:12 -0000	1.8
+++ admin/user/user_bulk.php	9 Jun 2008 13:36:06 -0000
@@ -16,7 +16,7 @@
 // array of bulk operations
 // create the bulk operations form
 $action_form = new user_bulk_action_form();
-if ($data = $action_form->get_data(false)) {
+if ($data = $action_form->get_data()) {
     // check if an action should be performed and do so
     switch ($data->action) {
         case 1: redirect($CFG->wwwroot.'/'.$CFG->admin.'/user/user_bulk_confirm.php');
@@ -29,7 +29,7 @@
 
 $user_bulk_form = new user_bulk_form(null, get_selection_data($ufiltering));
 
-if ($data = $user_bulk_form->get_data(false)) {
+if ($data = $user_bulk_form->get_data()) {
     if (!empty($data->addall)) {
         add_selection_all($ufiltering);
 
Index: admin/user/user_bulk_confirm.php
===================================================================
RCS file: /cvsroot/moodle/moodle/admin/user/user_bulk_confirm.php,v
retrieving revision 1.6
diff -u -r1.6 user_bulk_confirm.php
--- admin/user/user_bulk_confirm.php	2 Jun 2008 21:56:06 -0000	1.6
+++ admin/user/user_bulk_confirm.php	9 Jun 2008 13:36:06 -0000
@@ -29,7 +29,7 @@
                 continue;
             }
             $auth = get_auth_plugin($user->auth);
-            $result = $auth->user_confirm(addslashes($user->username), addslashes($user->secret));
+            $result = $auth->user_confirm($user->username, $user->secret);
             if ($result != AUTH_CONFIRM_OK && $result != AUTH_CONFIRM_ALREADY) {
                 notify(get_string('usernotconfirmed', '', fullname($user, true)));
             }
Index: admin/xmldb/actions/edit_xml_file/edit_xml_file.class.php
===================================================================
RCS file: /cvsroot/moodle/moodle/admin/xmldb/actions/edit_xml_file/edit_xml_file.class.php,v
retrieving revision 1.7
diff -u -r1.7 edit_xml_file.class.php
--- admin/xmldb/actions/edit_xml_file/edit_xml_file.class.php	15 May 2008 21:40:16 -0000	1.7
+++ admin/xmldb/actions/edit_xml_file/edit_xml_file.class.php	9 Jun 2008 13:36:11 -0000
@@ -78,7 +78,7 @@
 
     /// Get the dir containing the file
         $dirpath = required_param('dir', PARAM_PATH);
-        $dirpath = $CFG->dirroot . stripslashes_safe($dirpath);
+        $dirpath = $CFG->dirroot . $dirpath;
 
     /// Get the correct dir
         if (!empty($XMLDB->dbdirs)) {
Index: course/import/activities/index.php
===================================================================
RCS file: /cvsroot/moodle/moodle/course/import/activities/index.php,v
retrieving revision 1.14
diff -u -r1.14 index.php
--- course/import/activities/index.php	1 Jun 2008 17:53:26 -0000	1.14
+++ course/import/activities/index.php	9 Jun 2008 13:36:35 -0000
@@ -10,8 +10,6 @@
     $page             = optional_param('page', 0, PARAM_INT);
     $filename         = optional_param('filename', 0, PARAM_PATH);
 
-    $fromcoursesearch = stripslashes($fromcoursesearch); // TODO: remove soon
-
     $strimportactivities = get_string('importactivities');
 
     if (! ($course = $DB->get_record("course", array("id"=>$id)))) {
Index: admin/xmldb/actions/move_updown_key/move_updown_key.class.php
===================================================================
RCS file: /cvsroot/moodle/moodle/admin/xmldb/actions/move_updown_key/move_updown_key.class.php,v
retrieving revision 1.4
diff -u -r1.4 move_updown_key.class.php
--- admin/xmldb/actions/move_updown_key/move_updown_key.class.php	10 Oct 2007 05:25:30 -0000	1.4
+++ admin/xmldb/actions/move_updown_key/move_updown_key.class.php	9 Jun 2008 13:36:12 -0000
@@ -62,7 +62,7 @@
     /// Do the job, setting result as needed
     /// Get the dir containing the file
         $dirpath = required_param('dir', PARAM_PATH);
-        $dirpath = $CFG->dirroot . stripslashes_safe($dirpath);
+        $dirpath = $CFG->dirroot . $dirpath;
 
     /// Get the correct dirs
         if (!empty($XMLDB->dbdirs)) {
Index: question/format/gift/format.php
===================================================================
RCS file: /cvsroot/moodle/moodle/question/format/gift/format.php,v
retrieving revision 1.28
diff -u -r1.28 format.php
--- question/format/gift/format.php	1 May 2008 12:21:55 -0000	1.28
+++ question/format/gift/format.php	9 Jun 2008 13:37:57 -0000
@@ -59,7 +59,7 @@
         if (strpos($answer,"#") > 0){
             $hashpos = strpos($answer,"#");
             $comment = substr($answer, $hashpos+1);
-            $comment = addslashes(trim($this->escapedchar_post($comment)));
+            $comment = trim($this->escapedchar_post($comment));
             $answer  = substr($answer, 0, $hashpos);
         } else {
             $comment = " ";
@@ -159,7 +159,7 @@
                 // name will be assigned after processing question text below
             } else {
                 $questionname = substr($text, 0, $namefinish);
-                $question->name = addslashes(trim($this->escapedchar_post($questionname)));
+                $question->name = trim($this->escapedchar_post($questionname));
                 $text = trim(substr($text, $namefinish+2)); // Remove name from text
             }
         } else {
@@ -212,7 +212,7 @@
             }          
         }
         $question->questiontextformat = $questiontextformat;
-        $question->questiontext = addslashes(trim($this->escapedchar_post($questiontext)));
+        $question->questiontext = trim($this->escapedchar_post($questiontext));
 
         // set question name if not already set
         if ($question->name === false) {
@@ -325,7 +325,7 @@
                     }
                     $question->fraction[$key] = $answer_weight;
                     $question->feedback[$key] = $this->commentparser($answer); // commentparser also removes comment from $answer
-                    $question->answer[$key]   = addslashes($this->escapedchar_post($answer));
+                    $question->answer[$key]   = $this->escapedchar_post($answer);
                     $question->correctfeedback = '';
                     $question->partiallycorrectfeedback = '';
                     $question->incorrectfeedback = '';
@@ -360,8 +360,8 @@
                     }
 
                     $marker = strpos($answer,"->");
-                    $question->subquestions[$key] = addslashes(trim($this->escapedchar_post(substr($answer, 0, $marker))));
-                    $question->subanswers[$key]   = addslashes(trim($this->escapedchar_post(substr($answer, $marker+2))));
+                    $question->subquestions[$key] = trim($this->escapedchar_post(substr($answer, 0, $marker)));
+                    $question->subanswers[$key]   = trim($this->escapedchar_post(substr($answer, $marker+2)));
 
                 }  // end foreach answer
     
@@ -415,7 +415,7 @@
                     }
                     $question->fraction[$key] = $answer_weight;
                     $question->feedback[$key] = $this->commentparser($answer); //commentparser also removes comment from $answer
-                    $question->answer[$key]   = addslashes($this->escapedchar_post($answer));
+                    $question->answer[$key]   = $this->escapedchar_post($answer);
                 }     // end foreach
 
                 //$question->usecase = 0;  // Ignore case
Index: lib/editor/htmlarea/htmlarea.php
===================================================================
RCS file: /cvsroot/moodle/moodle/lib/editor/htmlarea/htmlarea.php,v
retrieving revision 1.28
diff -u -r1.28 htmlarea.php
--- lib/editor/htmlarea/htmlarea.php	28 Feb 2008 08:14:20 -0000	1.28
+++ lib/editor/htmlarea/htmlarea.php	9 Jun 2008 13:37:14 -0000
@@ -1817,8 +1817,8 @@
     var editor = this;
     var selectedtxt = "";
     <?php
-    $strreplaced = addslashes(get_string('itemsreplaced','editor'));
-    $strnotfound = addslashes(get_string('searchnotfound','editor'));
+    $strreplaced = addslashes_js(get_string('itemsreplaced','editor'));
+    $strnotfound = addslashes_js(get_string('searchnotfound','editor'));
     ?>
     var strReplaced = '<?php echo $strreplaced ?>';
     var strNotfound = '<?php echo $strnotfound ?>';
@@ -2076,10 +2076,7 @@
             if (HTMLArea.is_gecko) {
                 if (confirm("<?php
                     $strmoz = get_string('cutpastemozilla','editor');
-                    $strmoz = preg_replace("/[\n|\r]+/", "", $strmoz);
-                    $strmoz = str_replace('<br />', '\\n', $strmoz);
-
-                    echo addslashes($strmoz);
+                    echo addslashes_js($strmoz);
 
                     ?>"))
                     window.open("http://moodle.org/mozillahelp");
Index: lib/editor/htmlarea/coursefiles.php
===================================================================
RCS file: /cvsroot/moodle/moodle/lib/editor/htmlarea/coursefiles.php,v
retrieving revision 1.17
diff -u -r1.17 coursefiles.php
--- lib/editor/htmlarea/coursefiles.php	2 Jun 2008 21:05:50 -0000	1.17
+++ lib/editor/htmlarea/coursefiles.php	9 Jun 2008 13:37:12 -0000
@@ -387,7 +387,7 @@
             html_header($course, $wdir);
             if (($text != '') and confirm_sesskey()) {
                 $fileptr = fopen($basedir.$file,"w");
-                fputs($fileptr, stripslashes($text));
+                fputs($fileptr, $text);
                 fclose($fileptr);
                 displaydir($wdir);
 
Index: question/format.php
===================================================================
RCS file: /cvsroot/moodle/moodle/question/format.php,v
retrieving revision 1.43
diff -u -r1.43 format.php
--- question/format.php	6 Jun 2008 14:43:16 -0000	1.43
+++ question/format.php	9 Jun 2008 13:37:55 -0000
@@ -784,7 +784,7 @@
         } else {
             $format = $question->questiontextformat;
         }
-        return format_text(stripslashes($question->questiontext), $format, $formatoptions);
+        return format_text($question->questiontext, $format, $formatoptions);
     }
 
 
Index: question/category_class.php
===================================================================
RCS file: /cvsroot/moodle/moodle/question/category_class.php,v
retrieving revision 1.41
diff -u -r1.41 category_class.php
--- question/category_class.php	6 Jun 2008 14:43:15 -0000	1.41
+++ question/category_class.php	9 Jun 2008 13:37:54 -0000
@@ -428,7 +428,7 @@
                                           WHERE c2.id = ?
                                             AND c1.contextid = c2.contextid", array($updateid))){
             // If the question name has changed, rename any random questions in that category.
-            if (addslashes($oldcat->name) != $cat->name) {
+            if ($oldcat->name != $cat->name) {
                 $randomqname = $QTYPES[RANDOM]->question_name($cat);
                 $DB->set_field('question', 'name', $randomqname, array('category' => $cat->id), 'qtype', RANDOM);
                 // Ignore errors here. It is not a big deal if the questions are not renamed.
Index: question/comment.html
===================================================================
RCS file: /cvsroot/moodle/moodle/question/comment.html,v
retrieving revision 1.6
diff -u -r1.6 comment.html
--- question/comment.html	24 Aug 2006 16:44:15 -0000	1.6
+++ question/comment.html	9 Jun 2008 13:37:54 -0000
@@ -10,7 +10,7 @@
     </td>
     <td>
       <?php
-        print_textarea($usehtmleditor, 15, 60, 630, 300, $prefix.'[comment]', stripslashes($state->manualcomment));
+        print_textarea($usehtmleditor, 15, 60, 630, 300, $prefix.'[comment]', $state->manualcomment);
       ?>
     </td>
   </tr>
Index: calendar/event.php
===================================================================
RCS file: /cvsroot/moodle/moodle/calendar/event.php,v
retrieving revision 1.83
diff -u -r1.83 event.php
--- calendar/event.php	4 Jun 2008 21:34:15 -0000	1.83
+++ calendar/event.php	9 Jun 2008 13:36:31 -0000
@@ -126,7 +126,7 @@
                 print_error('nopermissions');
             }
 
-            if($form = data_submitted(false)) {
+            if($form = data_submitted()) {
 
                 $form->name = clean_param(strip_tags($form->name,'<lang><span>'), PARAM_CLEAN);
 
@@ -194,7 +194,7 @@
 
         case 'new':
             $title = get_string('newevent', 'calendar');
-            $form = data_submitted(false);
+            $form = data_submitted();
             if(!empty($form) && !empty($form->name)) {
 
                 $form->name = clean_text(strip_tags($form->name, '<lang><span>'));
Index: calendar/preferences.php
===================================================================
RCS file: /cvsroot/moodle/moodle/calendar/preferences.php,v
retrieving revision 1.20
diff -u -r1.20 preferences.php
--- calendar/preferences.php	1 Jun 2008 14:25:06 -0000	1.20
+++ calendar/preferences.php	9 Jun 2008 13:36:31 -0000
@@ -18,7 +18,7 @@
 
 /// If data submitted, then process and store.
 
-    if ($form = data_submitted(false)) {
+    if ($form = data_submitted()) {
         foreach ($form as $preference => $value) {
             switch ($preference) {
                 case 'timeformat':
Index: mod/data/templates.php
===================================================================
RCS file: /cvsroot/moodle/moodle/mod/data/templates.php,v
retrieving revision 1.75
diff -u -r1.75 templates.php
--- mod/data/templates.php	6 Jun 2008 07:36:18 -0000	1.75
+++ mod/data/templates.php	9 Jun 2008 13:37:24 -0000
@@ -116,7 +116,7 @@
 /// html editor is by default disabled
     $editor = isset($SESSION->data_use_editor) ? $SESSION->data_use_editor : (can_use_html_editor() ? 1 : 0);
 
-    if (($mytemplate = data_submitted($CFG->wwwroot.'/mod/data/templates.php')) && confirm_sesskey()) {
+    if (($mytemplate = data_submitted()) && confirm_sesskey()) {
         $newtemplate->id = $data->id;
         $newtemplate->{$mode} = $mytemplate->template;
 
Index: mod/data/comment.php
===================================================================
RCS file: /cvsroot/moodle/moodle/mod/data/comment.php,v
retrieving revision 1.22
diff -u -r1.22 comment.php
--- mod/data/comment.php	5 Jun 2008 19:26:57 -0000	1.22
+++ mod/data/comment.php	9 Jun 2008 13:37:22 -0000
@@ -68,7 +68,7 @@
 
     switch ($mode) {
         case 'add':
-            if (!$formadata = $mform->get_data(false)) {
+            if (!$formadata = $mform->get_data()) {
                 break; // something is wrong here, try again
             }
 
Index: mod/data/edit.php
===================================================================
RCS file: /cvsroot/moodle/moodle/mod/data/edit.php,v
retrieving revision 1.39
diff -u -r1.39 edit.php
--- mod/data/edit.php	5 Jun 2008 19:26:57 -0000	1.39
+++ mod/data/edit.php	9 Jun 2008 13:37:23 -0000
@@ -141,7 +141,7 @@
 
 /// Process incoming data for adding/updating records
 
-    if ($datarecord = data_submitted(false) and confirm_sesskey()) {
+    if ($datarecord = data_submitted() and confirm_sesskey()) {
 
         $ignorenames = array('MAX_FILE_SIZE','sesskey','d','rid','saveandview','cancel');  // strings to be ignored in input data
 
Index: mod/data/field.php
===================================================================
RCS file: /cvsroot/moodle/moodle/mod/data/field.php,v
retrieving revision 1.28
diff -u -r1.28 field.php
--- mod/data/field.php	5 Jun 2008 19:26:57 -0000	1.28
+++ mod/data/field.php	9 Jun 2008 13:37:23 -0000
@@ -74,7 +74,7 @@
     switch ($mode) {
 
         case 'add':    ///add a new field
-            if (confirm_sesskey() and $fieldinput = data_submitted(false)){
+            if (confirm_sesskey() and $fieldinput = data_submitted()){
 
                 //$fieldinput->name = data_clean_field_name($fieldinput->name);
 
@@ -108,7 +108,7 @@
 
 
         case 'update':    ///update a field
-            if (confirm_sesskey() and $fieldinput = data_submitted(false)){
+            if (confirm_sesskey() and $fieldinput = data_submitted()){
 
                 //$fieldinput->name = data_clean_field_name($fieldinput->name);
 
Index: admin/xmldb/actions/new_table/new_table.class.php
===================================================================
RCS file: /cvsroot/moodle/moodle/admin/xmldb/actions/new_table/new_table.class.php,v
retrieving revision 1.7
diff -u -r1.7 new_table.class.php
--- admin/xmldb/actions/new_table/new_table.class.php	20 May 2008 23:24:41 -0000	1.7
+++ admin/xmldb/actions/new_table/new_table.class.php	9 Jun 2008 13:36:13 -0000
@@ -62,7 +62,7 @@
     /// Do the job, setting result as needed
     /// Get the dir containing the file
         $dirpath = required_param('dir', PARAM_PATH);
-        $dirpath = $CFG->dirroot . stripslashes_safe($dirpath);
+        $dirpath = $CFG->dirroot . $dirpath;
 
     /// Get the correct dirs
         if (!empty($XMLDB->dbdirs)) {
Index: grade/import/csv/index.php
===================================================================
RCS file: /cvsroot/moodle/moodle/grade/import/csv/index.php,v
retrieving revision 1.38
diff -u -r1.38 index.php
--- grade/import/csv/index.php	3 Jun 2008 16:11:00 -0000	1.38
+++ grade/import/csv/index.php	9 Jun 2008 13:36:41 -0000
@@ -89,7 +89,7 @@
 $mform2 = new grade_import_mapping_form(null, array('gradeitems'=>$gradeitems, 'header'=>$header));
 
 // if import form is submitted
-if ($formdata = $mform->get_data(false)) {
+if ($formdata = $mform->get_data()) {
 
     // Large files are likely to take their time and memory. Let PHP know
     // that we'll take longer, and that the process should be recycled soon
@@ -151,10 +151,10 @@
     $mform2->set_data(array('importcode'=>$importcode, 'id'=>$id));
     $mform2->display();
 
-//} else if (($formdata = data_submitted(false)) && !empty($formdata->map)) {
+//} else if (($formdata = data_submitted()) && !empty($formdata->map)) {
 
 // else if grade import mapping form is submitted
-} else if ($formdata = $mform2->get_data(false)) {
+} else if ($formdata = $mform2->get_data()) {
 
     $importcode = clean_param($formdata->importcode, PARAM_FILE);
     $filename = $CFG->dataroot.'/temp/gradeimport/cvs/'.$USER->id.'/'.$importcode;
Index: question/type/essay/questiontype.php
===================================================================
RCS file: /cvsroot/moodle/moodle/question/type/essay/questiontype.php,v
retrieving revision 1.25
diff -u -r1.25 questiontype.php
--- question/type/essay/questiontype.php	6 Jun 2008 14:43:17 -0000	1.25
+++ question/type/essay/questiontype.php	9 Jun 2008 13:38:03 -0000
@@ -84,7 +84,7 @@
 
         // get response value
         if (isset($state->responses[''])) {
-            $value = stripslashes_safe($state->responses['']);
+            $value = $state->responses[''];
         } else {
             $value = "";
         }
Index: admin/xmldb/actions/view_table_sql/view_table_sql.class.php
===================================================================
RCS file: /cvsroot/moodle/moodle/admin/xmldb/actions/view_table_sql/view_table_sql.class.php,v
retrieving revision 1.6
diff -u -r1.6 view_table_sql.class.php
--- admin/xmldb/actions/view_table_sql/view_table_sql.class.php	15 May 2008 21:40:15 -0000	1.6
+++ admin/xmldb/actions/view_table_sql/view_table_sql.class.php	9 Jun 2008 13:36:16 -0000
@@ -64,7 +64,7 @@
     /// Do the job, setting result as needed
     /// Get the dir containing the file
         $dirpath = required_param('dir', PARAM_PATH);
-        $dirpath = $CFG->dirroot . stripslashes_safe($dirpath);
+        $dirpath = $CFG->dirroot . $dirpath;
 
     /// Get the correct dirs
         if (!empty($XMLDB->dbdirs)) {
Index: admin/xmldb/actions/new_index/new_index.class.php
===================================================================
RCS file: /cvsroot/moodle/moodle/admin/xmldb/actions/new_index/new_index.class.php,v
retrieving revision 1.6
diff -u -r1.6 new_index.class.php
--- admin/xmldb/actions/new_index/new_index.class.php	20 May 2008 23:24:41 -0000	1.6
+++ admin/xmldb/actions/new_index/new_index.class.php	9 Jun 2008 13:36:13 -0000
@@ -62,7 +62,7 @@
     /// Do the job, setting result as needed
     /// Get the dir containing the file
         $dirpath = required_param('dir', PARAM_PATH);
-        $dirpath = $CFG->dirroot . stripslashes_safe($dirpath);
+        $dirpath = $CFG->dirroot . $dirpath;
 
     /// Get the correct dirs
         if (!empty($XMLDB->dbdirs)) {
Index: admin/xmldb/actions/move_updown_field/move_updown_field.class.php
===================================================================
RCS file: /cvsroot/moodle/moodle/admin/xmldb/actions/move_updown_field/move_updown_field.class.php,v
retrieving revision 1.4
diff -u -r1.4 move_updown_field.class.php
--- admin/xmldb/actions/move_updown_field/move_updown_field.class.php	10 Oct 2007 05:25:21 -0000	1.4
+++ admin/xmldb/actions/move_updown_field/move_updown_field.class.php	9 Jun 2008 13:36:12 -0000
@@ -62,7 +62,7 @@
     /// Do the job, setting result as needed
     /// Get the dir containing the file
         $dirpath = required_param('dir', PARAM_PATH);
-        $dirpath = $CFG->dirroot . stripslashes_safe($dirpath);
+        $dirpath = $CFG->dirroot . $dirpath;
 
     /// Get the correct dirs
         if (!empty($XMLDB->dbdirs)) {
Index: lib/editor/htmlarea/popups/preview.php
===================================================================
RCS file: /cvsroot/moodle/moodle/lib/editor/htmlarea/popups/preview.php,v
retrieving revision 1.4
diff -u -r1.4 preview.php
--- lib/editor/htmlarea/popups/preview.php	27 Jan 2007 23:23:44 -0000	1.4
+++ lib/editor/htmlarea/popups/preview.php	9 Jun 2008 13:37:15 -0000
@@ -11,7 +11,7 @@
     @header('Content-Type: text/html; charset=utf-8');
 
 
-    $imagetag = clean_text('<img src="'.htmlSpecialChars(stripslashes_safe($imageurl)).'" alt="" />');
+    $imagetag = clean_text('<img src="'.htmlSpecialChars($imageurl).'" alt="" />');
 
 ?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
Index: filter/tex/texdebug.php
===================================================================
RCS file: /cvsroot/moodle/moodle/filter/tex/texdebug.php,v
retrieving revision 1.24
diff -u -r1.24 texdebug.php
--- filter/tex/texdebug.php	2 Jun 2008 21:52:28 -0000	1.24
+++ filter/tex/texdebug.php	9 Jun 2008 13:36:39 -0000
@@ -219,7 +219,6 @@
         $gif = "$latex->temp_dir/$md5.gif";
 
         // put the expression as a file into the temp area
-        $expression = stripslashes($expression);
         $expression = html_entity_decode($expression);
         $output .= "<p>Processing TeX expression:</p><pre>$expression</pre>\n";
         $doc = $latex->construct_latex_document($expression);
Index: mod/forum/restorelib.php
===================================================================
RCS file: /cvsroot/moodle/moodle/mod/forum/restorelib.php,v
retrieving revision 1.68
diff -u -r1.68 restorelib.php
--- mod/forum/restorelib.php	5 Jun 2008 20:16:09 -0000	1.68
+++ mod/forum/restorelib.php	9 Jun 2008 13:37:36 -0000
@@ -95,7 +95,7 @@
 
             //Do some output
             if (!defined('RESTORE_SILENTLY')) {
-                echo "<li>".get_string("modulename","forum")." \"".format_string(stripslashes($forum->name),true)."\"</li>";
+                echo "<li>".get_string("modulename","forum")." \"".format_string($forum->name,true)."\"</li>";
             }
             backup_flush(300);
 
Index: mod/forum/search.php
===================================================================
RCS file: /cvsroot/moodle/moodle/mod/forum/search.php,v
retrieving revision 1.95
diff -u -r1.95 search.php
--- mod/forum/search.php	5 Jun 2008 20:16:10 -0000	1.95
+++ mod/forum/search.php	9 Jun 2008 13:37:36 -0000
@@ -160,7 +160,7 @@
 
     print_heading("$strsearchresults: $totalcount");
 
-    print_paging_bar($totalcount, $page, $perpage, "search.php?search=".urlencode(stripslashes($search))."&amp;id=$course->id&amp;perpage=$perpage&amp;");
+    print_paging_bar($totalcount, $page, $perpage, "search.php?search=".urlencode($search)."&amp;id=$course->id&amp;perpage=$perpage&amp;");
 
     //added to implement highlighting of search terms found only in HTML markup
     //fiedorow - 9/2/2005
@@ -236,7 +236,7 @@
                 $fulllink, $strippedsearch, -99, false);
     }
 
-    print_paging_bar($totalcount, $page, $perpage, "search.php?search=".urlencode(stripslashes($search))."&amp;id=$course->id&amp;perpage=$perpage&amp;");
+    print_paging_bar($totalcount, $page, $perpage, "search.php?search=".urlencode($search)."&amp;id=$course->id&amp;perpage=$perpage&amp;");
 
     print_footer($course);
 
Index: mod/forum/lib.php
===================================================================
RCS file: /cvsroot/moodle/moodle/mod/forum/lib.php,v
retrieving revision 1.676
diff -u -r1.676 lib.php
--- mod/forum/lib.php	5 Jun 2008 20:27:56 -0000	1.676
+++ mod/forum/lib.php	9 Jun 2008 13:37:34 -0000
@@ -2550,8 +2550,8 @@
     $forum->type = "$type";
     switch ($forum->type) {
         case "news":
-            $forum->name  = addslashes(get_string("namenews", "forum"));
-            $forum->intro = addslashes(get_string("intronews", "forum"));
+            $forum->name  = get_string("namenews", "forum");
+            $forum->intro = get_string("intronews", "forum");
             $forum->forcesubscribe = FORUM_FORCESUBSCRIBE;
             $forum->assessed = 0;
             if ($courseid == SITEID) {
@@ -2560,8 +2560,8 @@
             }
             break;
         case "social":
-            $forum->name  = addslashes(get_string("namesocial", "forum"));
-            $forum->intro = addslashes(get_string("introsocial", "forum"));
+            $forum->name  = get_string("namesocial", "forum");
+            $forum->intro = get_string("introsocial", "forum");
             $forum->assessed = 0;
             $forum->forcesubscribe = 0;
             break;
Index: mod/forum/subscribers.php
===================================================================
RCS file: /cvsroot/moodle/moodle/mod/forum/subscribers.php,v
retrieving revision 1.46
diff -u -r1.46 subscribers.php
--- mod/forum/subscribers.php	30 May 2008 16:47:21 -0000	1.46
+++ mod/forum/subscribers.php	9 Jun 2008 13:37:36 -0000
@@ -93,7 +93,7 @@
     $strsubscribers = get_string("subscribers", "forum");
     $strforums      = get_string("forums", "forum");
 
-    if ($frm = data_submitted(false)) {
+    if ($frm = data_submitted()) {
 
 /// A form was submitted so process the input
 
Index: grade/report/grader/preferences.php
===================================================================
RCS file: /cvsroot/moodle/moodle/grade/report/grader/preferences.php,v
retrieving revision 1.28
diff -u -r1.28 preferences.php
--- grade/report/grader/preferences.php	3 Jun 2008 16:10:58 -0000	1.28
+++ grade/report/grader/preferences.php	9 Jun 2008 13:36:43 -0000
@@ -49,7 +49,7 @@
 }
 
 // If data submitted, then process and store.
-if ($data = $mform->get_data(false)) {
+if ($data = $mform->get_data()) {
     foreach ($data as $preference => $value) {
         if (substr($preference, 0, 6) !== 'grade_') {
             continue;
Index: grade/report/grader/lib.php
===================================================================
RCS file: /cvsroot/moodle/moodle/grade/report/grader/lib.php,v
retrieving revision 1.147
diff -u -r1.147 lib.php
--- grade/report/grader/lib.php	3 Jun 2008 16:10:58 -0000	1.147
+++ grade/report/grader/lib.php	9 Jun 2008 13:36:43 -0000
@@ -227,7 +227,7 @@
                 if (empty($trimmed)) {
                      $feedback = NULL;
                 } else {
-                     $feedback = stripslashes($postedvalue);
+                     $feedback = $postedvalue;
                 }
             }
 
Index: grade/report/grader/ajax_callbacks.php
===================================================================
RCS file: /cvsroot/moodle/moodle/grade/report/grader/ajax_callbacks.php,v
retrieving revision 1.4
diff -u -r1.4 ajax_callbacks.php
--- grade/report/grader/ajax_callbacks.php	3 Jun 2008 16:10:58 -0000	1.4
+++ grade/report/grader/ajax_callbacks.php	9 Jun 2008 13:36:42 -0000
@@ -94,7 +94,7 @@
                 if (empty($trimmed)) {
                     $feedback = NULL;
                 } else {
-                    $feedback = stripslashes($newvalue);
+                    $feedback = $newvalue;
                 }
 
                 $finalvalue = $feedback;
Index: grade/report/grader/index.php
===================================================================
RCS file: /cvsroot/moodle/moodle/grade/report/grader/index.php,v
retrieving revision 1.76
diff -u -r1.76 index.php
--- grade/report/grader/index.php	3 Jun 2008 16:10:58 -0000	1.76
+++ grade/report/grader/index.php	9 Jun 2008 13:36:42 -0000
@@ -149,7 +149,7 @@
 }
 
 /// processing posted grades & feedback here
-if ($data = data_submitted(false) and confirm_sesskey() and has_capability('moodle/grade:edit', $context)) {
+if ($data = data_submitted() and confirm_sesskey() and has_capability('moodle/grade:edit', $context)) {
     $warnings = $report->process_data($data);
 } else {
     $warnings = array();
Index: question/type/shortanswer/questiontype.php
===================================================================
RCS file: /cvsroot/moodle/moodle/question/type/shortanswer/questiontype.php,v
retrieving revision 1.26
diff -u -r1.26 questiontype.php
--- question/type/shortanswer/questiontype.php	6 Jun 2008 14:43:17 -0000	1.26
+++ question/type/shortanswer/questiontype.php	9 Jun 2008 13:38:05 -0000
@@ -206,7 +206,7 @@
     function test_response(&$question, $state, $answer) {
         // Trim the response before it is saved in the database. See MDL-10709
         $state->responses[''] = trim($state->responses['']);
-        return $this->compare_string_with_wildcard(stripslashes_safe($state->responses['']),
+        return $this->compare_string_with_wildcard($state->responses[''],
                 $answer->answer, !$question->options->usecase);
     }
 
@@ -235,7 +235,7 @@
     function get_correct_responses(&$question, &$state) {
         $response = parent::get_correct_responses($question, $state);
         if (is_array($response)) {
-            $response[''] = addslashes(str_replace('\*', '*', stripslashes($response[''])));
+            $response[''] = str_replace('\*', '*', $response['']);
         }
         return $response;
     }
Index: mod/choice/lib.php
===================================================================
RCS file: /cvsroot/moodle/moodle/mod/choice/lib.php,v
retrieving revision 1.87
diff -u -r1.87 lib.php
--- mod/choice/lib.php	4 Jun 2008 06:42:54 -0000	1.87
+++ mod/choice/lib.php	9 Jun 2008 13:37:22 -0000
@@ -351,7 +351,7 @@
     switch ($forcepublish) {
         case CHOICE_PUBLISH_NAMES:
                 echo '<div id="tablecontainer">';
-                echo '<form id="attemptsform" method="post" action="'.$_SERVER['PHP_SELF'].'" onsubmit="var menu = document.getElementById(\'menuaction\'); return (menu.options[menu.selectedIndex].value == \'delete\' ? \''.addslashes(get_string('deleteattemptcheck','quiz')).'\' : true);">';
+                echo '<form id="attemptsform" method="post" action="'.$_SERVER['PHP_SELF'].'" onsubmit="var menu = document.getElementById(\'menuaction\'); return (menu.options[menu.selectedIndex].value == \'delete\' ? \''.addslashes_js(get_string('deleteattemptcheck','quiz')).'\' : true);">';
                 echo '<div>';
                 echo '<input type="hidden" name="id" value="'.$cm->id.'" />';
                 echo '<input type="hidden" name="mode" value="overview" />';
Index: question/format/qti2/format.php
===================================================================
RCS file: /cvsroot/moodle/moodle/question/format/qti2/format.php,v
retrieving revision 1.15
diff -u -r1.15 format.php
--- question/format/qti2/format.php	6 Jun 2008 14:43:17 -0000	1.15
+++ question/format/qti2/format.php	9 Jun 2008 13:37:59 -0000
@@ -289,7 +289,7 @@
 
             // results are first written into string (and then to a file)
             $count++;
-            echo "<hr /><p><b>$count</b>. ".stripslashes($question->questiontext)."</p>";
+            echo "<hr /><p><b>$count</b>. ".$question->questiontext."</p>";
             $expout = $this->writequestion( $question , null, true, $path) . "\n";
             $expout = $this->presave_process( $expout );
 
Index: admin/xmldb/actions/view_key_xml/view_key_xml.class.php
===================================================================
RCS file: /cvsroot/moodle/moodle/admin/xmldb/actions/view_key_xml/view_key_xml.class.php,v
retrieving revision 1.4
diff -u -r1.4 view_key_xml.class.php
--- admin/xmldb/actions/view_key_xml/view_key_xml.class.php	10 Oct 2007 05:25:29 -0000	1.4
+++ admin/xmldb/actions/view_key_xml/view_key_xml.class.php	9 Jun 2008 13:36:14 -0000
@@ -66,7 +66,7 @@
         $select = required_param('select', PARAM_ALPHA); //original/edited
     /// Get the dir containing the file
         $dirpath = required_param('dir', PARAM_PATH);
-        $dirpath = $CFG->dirroot . stripslashes_safe($dirpath);
+        $dirpath = $CFG->dirroot . $dirpath;
 
     /// Get the correct dir
         if ($select == 'original') {
Index: admin/xmldb/actions/delete_statement/delete_statement.class.php
===================================================================
RCS file: /cvsroot/moodle/moodle/admin/xmldb/actions/delete_statement/delete_statement.class.php,v
retrieving revision 1.5
diff -u -r1.5 delete_statement.class.php
--- admin/xmldb/actions/delete_statement/delete_statement.class.php	10 Oct 2007 05:25:20 -0000	1.5
+++ admin/xmldb/actions/delete_statement/delete_statement.class.php	9 Jun 2008 13:36:08 -0000
@@ -64,7 +64,7 @@
 
     /// Get the dir containing the file
         $dirpath = required_param('dir', PARAM_PATH);
-        $dirpath = $CFG->dirroot . stripslashes_safe($dirpath);
+        $dirpath = $CFG->dirroot . $dirpath;
         $statementparam = required_param('statement', PARAM_CLEAN);
 
         $confirmed = optional_param('confirmed', false, PARAM_BOOL);
Index: user/profile/definelib.php
===================================================================
RCS file: /cvsroot/moodle/moodle/user/profile/definelib.php,v
retrieving revision 1.14
diff -u -r1.14 definelib.php
--- user/profile/definelib.php	2 Jun 2008 21:47:32 -0000	1.14
+++ user/profile/definelib.php	9 Jun 2008 13:38:06 -0000
@@ -420,7 +420,7 @@
     if ($categoryform->is_cancelled()) {
         redirect($redirect);
     } else {
-        if ($data = $categoryform->get_data(false)) {
+        if ($data = $categoryform->get_data()) {
             if (empty($data->id)) {
                 unset($data->id);
                 $data->sortorder = $DB->count_records('user_info_category') + 1;
Index: mod/scorm/datamodels/scorm_13lib.php
===================================================================
RCS file: /cvsroot/moodle/moodle/mod/scorm/datamodels/scorm_13lib.php,v
retrieving revision 1.11
diff -u -r1.11 scorm_13lib.php
--- mod/scorm/datamodels/scorm_13lib.php	5 Jun 2008 21:07:09 -0000	1.11
+++ mod/scorm/datamodels/scorm_13lib.php	9 Jun 2008 13:37:48 -0000
@@ -66,7 +66,7 @@
         $parents[$level]='/';
         foreach ($scoes as $pos=>$sco) {
             $isvisible = false;
-            $sco->title = stripslashes($sco->title);
+            $sco->title = $sco->title;
             if (isset($optionaldatas[$sco->identifier])) {
                 if (!isset($optionaldatas[$sco->identifier]->isvisible) || 
                    (isset($optionaldatas[$sco->identifier]->isvisible) && ($optionaldatas[$sco->identifier]->isvisible == 'true'))) {
Index: mod/scorm/datamodels/scorm_12.js.php
===================================================================
RCS file: /cvsroot/moodle/moodle/mod/scorm/datamodels/scorm_12.js.php,v
retrieving revision 1.9
diff -u -r1.9 scorm_12.js.php
--- mod/scorm/datamodels/scorm_12.js.php	2 May 2008 10:48:54 -0000	1.9
+++ mod/scorm/datamodels/scorm_12.js.php	9 Jun 2008 13:37:46 -0000
@@ -55,7 +55,7 @@
         'cmi._version':{'defaultvalue':'3.4', 'mod':'r', 'writeerror':'402'},
         'cmi.core._children':{'defaultvalue':core_children, 'mod':'r', 'writeerror':'402'},
         'cmi.core.student_id':{'defaultvalue':'<?php echo $userdata->student_id ?>', 'mod':'r', 'writeerror':'403'},
-        'cmi.core.student_name':{'defaultvalue':'<?php echo addslashes($userdata->student_name) ?>', 'mod':'r', 'writeerror':'403'},
+        'cmi.core.student_name':{'defaultvalue':'<?php echo addslashes_js($userdata->student_name) ?>', 'mod':'r', 'writeerror':'403'},
         'cmi.core.lesson_location':{'defaultvalue':'<?php echo isset($userdata->{'cmi.core.lesson_location'})?$userdata->{'cmi.core.lesson_location'}:'' ?>', 'format':CMIString256, 'mod':'rw', 'writeerror':'405'},
         'cmi.core.credit':{'defaultvalue':'<?php echo $userdata->credit ?>', 'mod':'r', 'writeerror':'403'},
         'cmi.core.lesson_status':{'defaultvalue':'<?php echo isset($userdata->{'cmi.core.lesson_status'})?$userdata->{'cmi.core.lesson_status'}:'' ?>', 'format':CMIStatus, 'mod':'rw', 'writeerror':'405'},
Index: mod/scorm/datamodels/scorm_13.js.php
===================================================================
RCS file: /cvsroot/moodle/moodle/mod/scorm/datamodels/scorm_13.js.php,v
retrieving revision 1.36
diff -u -r1.36 scorm_13.js.php
--- mod/scorm/datamodels/scorm_13.js.php	2 May 2008 10:48:54 -0000	1.36
+++ mod/scorm/datamodels/scorm_13.js.php	9 Jun 2008 13:37:48 -0000
@@ -1,6 +1,6 @@
 <?php
     if (isset($userdata->status)) {
-        //if ($userdata->status == ''&& (!(($userdata->{'cmi.exit'} == 'suspend') || ($userdata->{'cmi.exit'} == 'logout'))&& !($userdata->{'adl.nav.request'} == 'suspendAll'))||($userdata->{'cmi.exit'} == 'normal')) {      //antes solo llegaba esta l�nea hasta el &&
+        //if ($userdata->status == ''&& (!(($userdata->{'cmi.exit'} == 'suspend') || ($userdata->{'cmi.exit'} == 'logout'))&& !($userdata->{'adl.nav.request'} == 'suspendAll'))||($userdata->{'cmi.exit'} == 'normal')) {      //antes solo llegaba esta l�nea hasta el &&
         if (!isset($userdata->{'cmi.exit'}) || (($userdata->{'cmi.exit'} == 'time-out') || ($userdata->{'cmi.exit'} == 'normal'))) { 
                 $userdata->entry = 'ab-initio';
         } else {
@@ -140,7 +140,7 @@
         'cmi.interactions.n.description':{'pattern':CMIIndex, 'format':CMILangString250, 'mod':'rw'},
         'cmi.launch_data':{'defaultvalue':<?php echo isset($userdata->datafromlms)?'\''.$userdata->datafromlms.'\'':'null' ?>, 'mod':'r'},
         'cmi.learner_id':{'defaultvalue':'<?php echo $userdata->student_id ?>', 'mod':'r'},
-        'cmi.learner_name':{'defaultvalue':'<?php echo addslashes($userdata->student_name) ?>', 'mod':'r'},
+        'cmi.learner_name':{'defaultvalue':'<?php echo addslashes_js($userdata->student_name) ?>', 'mod':'r'},
         'cmi.learner_preference._children':{'defaultvalue':student_preference_children, 'mod':'r'},
         'cmi.learner_preference.audio_level':{'defaultvalue':'1', 'format':CMIDecimal, 'range':audio_range, 'mod':'rw'},
         'cmi.learner_preference.language':{'defaultvalue':'', 'format':CMILang, 'mod':'rw'},
Index: mod/scorm/datamodels/scormlib.php
===================================================================
RCS file: /cvsroot/moodle/moodle/mod/scorm/datamodels/scormlib.php,v
retrieving revision 1.10
diff -u -r1.10 scormlib.php
--- mod/scorm/datamodels/scormlib.php	5 Jun 2008 10:02:27 -0000	1.10
+++ mod/scorm/datamodels/scormlib.php	9 Jun 2008 13:37:49 -0000
@@ -5,7 +5,7 @@
         if ($block['name'] == 'RESOURCES') {
             foreach ($block['children'] as $resource) {
                 if ($resource['name'] == 'RESOURCE') {
-                    $resources[addslashes($resource['attrs']['IDENTIFIER'])] = $resource['attrs'];
+                    $resources[addslashes_js($resource['attrs']['IDENTIFIER'])] = $resource['attrs'];
                 }
             }
         }
@@ -43,7 +43,7 @@
                     }
                 break;
                 case 'MANIFEST':
-                    $manifest = addslashes($block['attrs']['IDENTIFIER']);
+                    $manifest = $block['attrs']['IDENTIFIER'];
                     $organization = '';
                     $resources = array();
                     $resources = scorm_get_resources($block['children']);
@@ -55,8 +55,8 @@
                                 $sco->identifier = $item;
                                 $sco->title = $item;
                                 $sco->parent = '/';
-                                $sco->launch = addslashes($resource['HREF']);
-                                $sco->scormtype = addslashes($resource['ADLCP:SCORMTYPE']);
+                                $sco->launch = $resource['HREF'];
+                                $sco->scormtype = $resource['ADLCP:SCORMTYPE'];
                                 $scoes->elements[$manifest][$organization][$item] = $sco;
                             }
                         }
@@ -64,12 +64,12 @@
                 break;
                 case 'ORGANIZATIONS':
                     if (!isset($scoes->defaultorg)) {
-                        $scoes->defaultorg = addslashes($block['attrs']['DEFAULT']);
+                        $scoes->defaultorg = $block['attrs']['DEFAULT'];
                     }
                     $scoes = scorm_get_manifest($block['children'],$scoes);
                 break;
                 case 'ORGANIZATION':
-                    $identifier = addslashes($block['attrs']['IDENTIFIER']);
+                    $identifier = $block['attrs']['IDENTIFIER'];
                     $organization = '';
                     $scoes->elements[$manifest][$organization][$identifier]->identifier = $identifier;
                     $scoes->elements[$manifest][$organization][$identifier]->parent = '/';
@@ -91,31 +91,31 @@
                     $parent = array_pop($parents);
                     array_push($parents, $parent);
 
-                    $identifier = addslashes($block['attrs']['IDENTIFIER']);
+                    $identifier = $block['attrs']['IDENTIFIER'];
                     $scoes->elements[$manifest][$organization][$identifier]->identifier = $identifier;
                     $scoes->elements[$manifest][$organization][$identifier]->parent = $parent->identifier;
                     if (!isset($block['attrs']['ISVISIBLE'])) {
                         $block['attrs']['ISVISIBLE'] = 'true';
                     }
-                    $scoes->elements[$manifest][$organization][$identifier]->isvisible = addslashes($block['attrs']['ISVISIBLE']);
+                    $scoes->elements[$manifest][$organization][$identifier]->isvisible = $block['attrs']['ISVISIBLE'];
                     if (!isset($block['attrs']['PARAMETERS'])) {
                         $block['attrs']['PARAMETERS'] = '';
                     }
-                    $scoes->elements[$manifest][$organization][$identifier]->parameters = addslashes($block['attrs']['PARAMETERS']);
+                    $scoes->elements[$manifest][$organization][$identifier]->parameters = $block['attrs']['PARAMETERS'];
                     if (!isset($block['attrs']['IDENTIFIERREF'])) {
                         $scoes->elements[$manifest][$organization][$identifier]->launch = '';
                         $scoes->elements[$manifest][$organization][$identifier]->scormtype = 'asset';
                     } else {
-                        $idref = addslashes($block['attrs']['IDENTIFIERREF']);
+                        $idref = $block['attrs']['IDENTIFIERREF'];
                         $base = '';
                         if (isset($resources[$idref]['XML:BASE'])) {
                             $base = $resources[$idref]['XML:BASE'];
                         }
-                        $scoes->elements[$manifest][$organization][$identifier]->launch = addslashes($base.$resources[$idref]['HREF']);
+                        $scoes->elements[$manifest][$organization][$identifier]->launch = $base.$resources[$idref]['HREF'];
                         if (empty($resources[$idref]['ADLCP:SCORMTYPE'])) {
                             $resources[$idref]['ADLCP:SCORMTYPE'] = 'asset';
                         }
-                        $scoes->elements[$manifest][$organization][$identifier]->scormtype = addslashes($resources[$idref]['ADLCP:SCORMTYPE']);
+                        $scoes->elements[$manifest][$organization][$identifier]->scormtype = $resources[$idref]['ADLCP:SCORMTYPE'];
                     }
 
                     $parent = new stdClass();
@@ -133,7 +133,7 @@
                     if (!isset($block['tagData'])) {
                         $block['tagData'] = '';
                     }
-                    $scoes->elements[$manifest][$parent->organization][$parent->identifier]->title = addslashes($block['tagData']);
+                    $scoes->elements[$manifest][$parent->organization][$parent->identifier]->title = $block['tagData'];
                 break;
                 case 'ADLCP:PREREQUISITES':
                     if ($block['attrs']['TYPE'] == 'aicc_script') {
@@ -142,7 +142,7 @@
                         if (!isset($block['tagData'])) {
                             $block['tagData'] = '';
                         }
-                        $scoes->elements[$manifest][$parent->organization][$parent->identifier]->prerequisites = addslashes($block['tagData']);
+                        $scoes->elements[$manifest][$parent->organization][$parent->identifier]->prerequisites = $block['tagData'];
                     }
                 break;
                 case 'ADLCP:MAXTIMEALLOWED':
@@ -151,7 +151,7 @@
                     if (!isset($block['tagData'])) {
                         $block['tagData'] = '';
                     }
-                    $scoes->elements[$manifest][$parent->organization][$parent->identifier]->maxtimeallowed = addslashes($block['tagData']);
+                    $scoes->elements[$manifest][$parent->organization][$parent->identifier]->maxtimeallowed = $block['tagData'];
                 break;
                 case 'ADLCP:TIMELIMITACTION':
                     $parent = array_pop($parents);
@@ -159,7 +159,7 @@
                     if (!isset($block['tagData'])) {
                         $block['tagData'] = '';
                     }
-                    $scoes->elements[$manifest][$parent->organization][$parent->identifier]->timelimitaction = addslashes($block['tagData']);
+                    $scoes->elements[$manifest][$parent->organization][$parent->identifier]->timelimitaction = $block['tagData'];
                 break;
                 case 'ADLCP:DATAFROMLMS':
                     $parent = array_pop($parents);
@@ -167,7 +167,7 @@
                     if (!isset($block['tagData'])) {
                         $block['tagData'] = '';
                     }
-                    $scoes->elements[$manifest][$parent->organization][$parent->identifier]->datafromlms = addslashes($block['tagData']);
+                    $scoes->elements[$manifest][$parent->organization][$parent->identifier]->datafromlms = $block['tagData'];
                 break;
                 case 'ADLCP:MASTERYSCORE':
                     $parent = array_pop($parents);
@@ -175,7 +175,7 @@
                     if (!isset($block['tagData'])) {
                         $block['tagData'] = '';
                     }
-                    $scoes->elements[$manifest][$parent->organization][$parent->identifier]->masteryscore = addslashes($block['tagData']);
+                    $scoes->elements[$manifest][$parent->organization][$parent->identifier]->masteryscore = $block['tagData'];
                 break;
                 case 'ADLCP:COMPLETIONTHRESHOLD':
                     $parent = array_pop($parents);
@@ -183,7 +183,7 @@
                     if (!isset($block['tagData'])) {
                         $block['tagData'] = '';
                     }
-                    $scoes->elements[$manifest][$parent->organization][$parent->identifier]->threshold = addslashes($block['tagData']);
+                    $scoes->elements[$manifest][$parent->organization][$parent->identifier]->threshold = $block['tagData'];
                 break;
                 case 'ADLNAV:PRESENTATION':
                     $parent = array_pop($parents);
@@ -485,7 +485,7 @@
                         $newitem->organization = $organization;
                         $standarddatas = array('parent', 'identifier', 'launch', 'scormtype', 'title');
                         foreach ($standarddatas as $standarddata) {
-                            $newitem->$standarddata = addslashes($item->$standarddata);
+                            $newitem->$standarddata = $item->$standarddata;
                         }
                         
                         $id = 0; 
Index: question/format/aiken/format.php
===================================================================
RCS file: /cvsroot/moodle/moodle/question/format/aiken/format.php,v
retrieving revision 1.6
diff -u -r1.6 format.php
--- question/format/aiken/format.php	11 Jul 2007 09:18:32 -0000	1.6
+++ question/format/aiken/format.php	9 Jun 2008 13:37:55 -0000
@@ -37,7 +37,7 @@
             $newlines = explode($endchar,$line);
             $foundQ = 0;
             for ($i=0; $i < count($newlines);$i++){
-                $nowline = addslashes($newlines[$i]);
+                $nowline = $newlines[$i];
                 ///Go through the array and build an object called $question
                 ///When done, add $question to $questions
                 if (strlen($nowline)< 2) {
@@ -66,7 +66,7 @@
                 } else {
                     //Must be the first line since no leader
                     $question->qtype = MULTICHOICE;
-                    $question->name = addslashes( substr($nowline,0,50) );
+                    $question->name = substr($nowline,0,50);
                     $question->questiontext = $nowline;
                     $question->single = 1;
                     $question->feedback[] = "";
Index: admin/xmldb/actions/view_structure_sql/view_structure_sql.class.php
===================================================================
RCS file: /cvsroot/moodle/moodle/admin/xmldb/actions/view_structure_sql/view_structure_sql.class.php,v
retrieving revision 1.6
diff -u -r1.6 view_structure_sql.class.php
--- admin/xmldb/actions/view_structure_sql/view_structure_sql.class.php	15 May 2008 21:40:02 -0000	1.6
+++ admin/xmldb/actions/view_structure_sql/view_structure_sql.class.php	9 Jun 2008 13:36:14 -0000
@@ -64,7 +64,7 @@
     /// Do the job, setting result as needed
     /// Get the dir containing the file
         $dirpath = required_param('dir', PARAM_PATH);
-        $dirpath = $CFG->dirroot . stripslashes_safe($dirpath);
+        $dirpath = $CFG->dirroot . $dirpath;
 
     /// Get the correct dirs
         if (!empty($XMLDB->dbdirs)) {
Index: blog/edit.php
===================================================================
RCS file: /cvsroot/moodle/moodle/blog/edit.php,v
retrieving revision 1.64
diff -u -r1.64 edit.php
--- blog/edit.php	2 Jun 2008 21:52:28 -0000	1.64
+++ blog/edit.php	9 Jun 2008 13:36:31 -0000
@@ -74,7 +74,7 @@
 
 if ($blogeditform->is_cancelled()){
     redirect($returnurl);
-} else if ($fromform = $blogeditform->get_data(false)){
+} else if ($fromform = $blogeditform->get_data()){
     //save stuff in db
     switch ($action) {
         case 'add':
Index: mod/feedback/item/multichoicerated/lib.php
===================================================================
RCS file: /cvsroot/moodle/moodle/mod/feedback/item/multichoicerated/lib.php,v
retrieving revision 1.2
diff -u -r1.2 lib.php
--- mod/feedback/item/multichoicerated/lib.php	30 Apr 2008 22:17:05 -0000	1.2
+++ mod/feedback/item/multichoicerated/lib.php	9 Jun 2008 13:37:28 -0000
@@ -56,7 +56,7 @@
         //die moeglichen Antworten extrahieren
         $info = $this->get_info($item);
         $lines = null;
-        $lines = explode (FEEDBACK_MULTICHOICERATED_LINE_SEP, stripslashes_safe($info->presentation));
+        $lines = explode (FEEDBACK_MULTICHOICERATED_LINE_SEP, $info->presentation);
         if(!is_array($lines)) return null;
 
         //die Werte holen
@@ -96,7 +96,7 @@
         
         $info = $this->get_info($item);
                 
-        $presentation = explode (FEEDBACK_MULTICHOICERATED_LINE_SEP, stripslashes_safe($info->presentation));
+        $presentation = explode (FEEDBACK_MULTICHOICERATED_LINE_SEP, $info->presentation);
         $index = 1;
         foreach($presentation as $pres){
             if($value->value == $index){
@@ -124,7 +124,7 @@
         if($analysedItem) {
             //echo '<table>';
             // $itemnr++;
-            echo '<tr><th colspan="2" align="left">'. $itemnr . '&nbsp;' . stripslashes($analysedItem[1]) .'</th></tr>';
+            echo '<tr><th colspan="2" align="left">'. $itemnr . '&nbsp;' . $analysedItem[1] .'</th></tr>';
             $analysedVals = $analysedItem[2];
             $pixnr = 0;
             $avg = 0.0;
@@ -157,7 +157,7 @@
 
         $worksheet->setFormat("<l><f><ro2><vo><c:green>");
         //frage schreiben
-        $worksheet->write_string($rowOffset, 0, stripslashes($analysed_item[1]));
+        $worksheet->write_string($rowOffset, 0, $analysed_item[1]);
         if(is_array($data)) {
             $avg = 0.0;
             for($i = 0; $i < sizeof($data); $i++) {
@@ -187,7 +187,7 @@
         $align = get_string('thisdirection') == 'ltr' ? 'left' : 'right';
         $info = $this->get_info($item);
         
-        $lines = explode (FEEDBACK_MULTICHOICERATED_LINE_SEP, stripslashes_safe($info->presentation));
+        $lines = explode (FEEDBACK_MULTICHOICERATED_LINE_SEP, $info->presentation);
         $requiredmark =  ($item->required == 1)?'<span class="feedback_required_mark">*</span>':'';
         if($highlightrequire AND $item->required AND intval($value) <= 0) {
             $highlight = 'bgcolor="#FFAAAA" class="missingrequire"';
@@ -195,7 +195,7 @@
             $highlight = '';
         }
     ?>
-        <td <?php echo $highlight;?> valign="top" align="<?php echo $align;?>"><?php echo format_text(stripslashes_safe($item->name) . $requiredmark, true, false, false);?></td>
+        <td <?php echo $highlight;?> valign="top" align="<?php echo $align;?>"><?php echo format_text($item->name . $requiredmark, true, false, false);?></td>
         <td valign="top" align="<?php echo $align;?>">
     <?php
         $index = 1;
Index: lib/editor/tinymce/jscripts/tiny_mce/plugins/spellchecker/classes/SpellChecker.php
===================================================================
RCS file: /cvsroot/moodle/moodle/lib/editor/tinymce/jscripts/tiny_mce/plugins/spellchecker/classes/SpellChecker.php,v
retrieving revision 1.1
diff -u -r1.1 SpellChecker.php
--- lib/editor/tinymce/jscripts/tiny_mce/plugins/spellchecker/classes/SpellChecker.php	12 May 2008 03:10:34 -0000	1.1
+++ lib/editor/tinymce/jscripts/tiny_mce/plugins/spellchecker/classes/SpellChecker.php	9 Jun 2008 13:37:16 -0000
@@ -3,7 +3,7 @@
  * $Id: SpellChecker.php,v 1.1 2008/05/12 03:10:34 scyrma Exp $
  *
  * @author Moxiecode
- * @copyright Copyright � 2004-2007, Moxiecode Systems AB, All rights reserved.
+ * @copyright Copyright � 2004-2007, Moxiecode Systems AB, All rights reserved.
  */
 
 class SpellChecker {
@@ -54,7 +54,7 @@
 	 * @param {String} $str Message to send back to user.
 	 */
 	function throwError($str) {
-		die('{"result":null,"id":null,"error":{"errstr":"' . addslashes($str) . '","errfile":"","errline":null,"errcontext":"","level":"FATAL"}}');
+		die('{"result":null,"id":null,"error":{"errstr":"' . addslashes_js($str) . '","errfile":"","errline":null,"errcontext":"","level":"FATAL"}}');
 	}
 }
 
Index: mod/wiki/view.php
===================================================================
RCS file: /cvsroot/moodle/moodle/mod/wiki/view.php,v
retrieving revision 1.82
diff -u -r1.82 view.php
--- mod/wiki/view.php	5 Jun 2008 09:14:42 -0000	1.82
+++ mod/wiki/view.php	9 Jun 2008 13:37:50 -0000
@@ -107,7 +107,7 @@
         define("EWIKI_PAGE_INDEX",$wiki_entry->pagename);
 
         /// If the page has a ' in it, it may have slashes added to it. Remove them if it does.
-        $page = ($page === false) ?  stripslashes(EWIKI_PAGE_INDEX) : stripslashes($page);
+        $page = ($page === false) ?  EWIKI_PAGE_INDEX : $page;
 
 ///     # Prevent ewiki getting id as PageID...
         unset($_REQUEST["id"]);
@@ -148,16 +148,6 @@
 
         define("EWIKI_INIT_PAGES", wiki_content_dir($wiki));
 
-///     # Moodle always addslashes to everything so we are going to strip them always
-///     # to allow wiki itself to add them again. It's a triple add-strip-add but
-///     # was the only way to solve the problem without modifying how the rest of
-///     # the module works.
-        include($CFG->dirroot."/mod/wiki/ewiki/fragments/strip_wonderful_slashes.php");
-
-        if (ini_get("register_globals")) {
-            #    include($CFG->dirroot."/mod/wiki/ewiki/fragments/strike_register_globals.php");
-        }
-
         # Database Handler
         include_once($CFG->dirroot."/mod/wiki/ewikimoodlelib.php");
         # Plugins
Index: mod/wiki/ewikimoodlelib.php
===================================================================
RCS file: /cvsroot/moodle/moodle/mod/wiki/ewikimoodlelib.php,v
retrieving revision 1.16
diff -u -r1.16 ewikimoodlelib.php
--- mod/wiki/ewikimoodlelib.php	4 Jun 2008 21:34:15 -0000	1.16
+++ mod/wiki/ewikimoodlelib.php	9 Jun 2008 13:37:50 -0000
@@ -310,6 +310,6 @@
 }
 
 function anydb_escape_string($s) {
-   return(addslashes($s));
+   return($s);
 }
 
Index: question/format/blackboard_6/format.php
===================================================================
RCS file: /cvsroot/moodle/moodle/question/format/blackboard_6/format.php,v
retrieving revision 1.17
diff -u -r1.17 format.php
--- question/format/blackboard_6/format.php	21 May 2008 07:53:23 -0000	1.17
+++ question/format/blackboard_6/format.php	9 Jun 2008 13:37:56 -0000
@@ -544,7 +544,7 @@
  */
 function process_common( $quest ) {
     $question = $this->defaultquestion();
-    $question->questiontext = addslashes($quest->QUESTION_BLOCK->text);
+    $question->questiontext = $quest->QUESTION_BLOCK->text;
     $question->name = shorten_text( $quest->id, 250 );
 
     return $question;
@@ -574,12 +574,12 @@
     
     if ($correct) {  // true is correct
         $question->answer = 1;
-        $question->feedbacktrue = addslashes($fback->correct);
-        $question->feedbackfalse = addslashes($fback->incorrect);
+        $question->feedbacktrue = $fback->correct;
+        $question->feedbackfalse = $fback->incorrect;
     } else {  // false is correct
         $question->answer = 0;
-        $question->feedbacktrue = addslashes($fback->incorrect);
-        $question->feedbackfalse = addslashes($fback->correct);
+        $question->feedbacktrue = $fback->incorrect;
+        $question->feedbackfalse = $fback->correct;
     }
     $question->correctanswer = $question->answer;
     $questions[] = $question;
@@ -613,10 +613,10 @@
             if (isset($response->ident[0]['varequal'][0]['#'])) {
                 //for BB Fill in the Blank, only interested in correct answers
                 if ($response->feedback = 'correct') {
-                    $answers[] = addslashes($response->ident[0]['varequal'][0]['#']);
+                    $answers[] = $response->ident[0]['varequal'][0]['#'];
                     $fractions[] = 1;
                     if (isset($feedback['correct'])) {
-                        $feedbacks[] = addslashes($feedback['correct']);
+                        $feedbacks[] = $feedback['correct'];
                     }
                     else {
                         $feedbacks[] = '';
@@ -632,7 +632,7 @@
     $answers[] = '*';
     $fractions[] = 0;
     if (isset($feedback['incorrect'])) {
-        $feedbacks[] = addslashes($feedback['incorrect']);
+        $feedbacks[] = $feedback['incorrect'];
     }
     else {
         $feedbacks[] = '';
@@ -658,7 +658,7 @@
     
     $feedback = array();
     foreach($quest->feedback as $fback) {
-        $feedback[$fback->ident] = addslashes($fback->text);
+        $feedback[$fback->ident] = $fback->text;
     }
  
     foreach($quest->responses as $response) {
@@ -679,7 +679,7 @@
 
     $i = 0;
     foreach($quest->RESPONSE_BLOCK->choices as $response) {
-        $question->answer[$i] = addslashes($response->text);
+        $question->answer[$i] = $response->text;
         if ($correct == $response->ident) {
             $question->fraction[$i] = 1;
             // this is a bit of a hack to catch the feedback... first we see if a 'correct' feedback exists
@@ -737,14 +737,14 @@
     }
     
     foreach ($quest->feedback as $fb) {
-        $feedback->{$fb->ident} = addslashes(trim($fb->text));
+        $feedback->{$fb->ident} = trim($fb->text);
     }
     
     $correct_answer_count = count($correct_answers);
     $choiceset = $quest->RESPONSE_BLOCK->choices;
     $i = 0;
     foreach($choiceset as $choice) {
-        $question->answer[$i] = addslashes(trim($choice->text));
+        $question->answer[$i] = trim($choice->text);
         if (in_array($choice->ident, $correct_answers)) {
             // correct answer
             $question->fraction[$i] = floor(100000/$correct_answer_count)/100000; // strange behavior if we have more than 5 decimal places
@@ -778,7 +778,7 @@
             // Added this code to put the possible solution that the
             // instructor gives as the Moodle answer for an essay question
             if ($feedback->ident == 'solution') {
-                $question->feedback = addslashes($feedback->text);
+                $question->feedback = $feedback->text;
             }
         }
         //Added because essay/questiontype.php:save_question_option is expecting a 
@@ -809,15 +809,15 @@
         foreach($quest->RESPONSE_BLOCK->subquestions as $qid => $subq) {
             foreach($quest->responses as $rid => $resp) {
                 if ($resp->ident == $subq->ident) {
-                    $correct = addslashes($resp->correct);
-                    $feedback = addslashes($resp->feedback);   
+                    $correct = $resp->correct;
+                    $feedback = $resp->feedback;   
                 }
             }
         
             foreach($subq->choices as $cid => $choice) {
                 if ($choice == $correct) {
-                    $question->subquestions[] = addslashes($subq->text);
-                    $question->subanswers[] = addslashes($quest->RIGHT_MATCH_BLOCK->matching_answerset[$cid]->text);
+                    $question->subquestions[] = $subq->text;
+                    $question->subanswers[] = $quest->RIGHT_MATCH_BLOCK->matching_answerset[$cid]->text;
                 }
             }
         }
Index: question/format/hotpot/format.php
===================================================================
RCS file: /cvsroot/moodle/moodle/question/format/hotpot/format.php,v
retrieving revision 1.16
diff -u -r1.16 format.php
--- question/format/hotpot/format.php	12 May 2008 22:56:48 -0000	1.16
+++ question/format/hotpot/format.php	9 Jun 2008 13:37:58 -0000
@@ -494,7 +494,7 @@
         // convert html entities to unicode and add slashes
         $str = preg_replace('/&#x([0-9a-f]+);/ie', "hotpot_charcode_to_utf8(hexdec('\\1'))", $str);
         $str = preg_replace('/&#([0-9]+);/e', "hotpot_charcode_to_utf8(\\1)", $str);
-        return addslashes($str);
+        return $str;
     }
 } // end class
 
Index: admin/xmldb/actions/XMLDBAction.class.php
===================================================================
RCS file: /cvsroot/moodle/moodle/admin/xmldb/actions/XMLDBAction.class.php,v
retrieving revision 1.4
diff -u -r1.4 XMLDBAction.class.php
--- admin/xmldb/actions/XMLDBAction.class.php	10 Oct 2007 05:25:31 -0000	1.4
+++ admin/xmldb/actions/XMLDBAction.class.php	9 Jun 2008 13:36:07 -0000
@@ -140,7 +140,7 @@
     /// If we are used any dir, save it in the lastused session object
     /// Some actions can use it to perform positioning
         if ($lastused = optional_param ('dir', NULL, PARAM_PATH)) {
-            $SESSION->lastused = stripslashes_safe($lastused);
+            $SESSION->lastused = $lastused;
         }
 
         $this->postaction = optional_param ('postaction', NULL, PARAM_ALPHAEXT);
Index: admin/xmldb/actions/template/template.class.php
===================================================================
RCS file: /cvsroot/moodle/moodle/admin/xmldb/actions/template/template.class.php,v
retrieving revision 1.4
diff -u -r1.4 template.class.php
--- admin/xmldb/actions/template/template.class.php	10 Oct 2007 05:25:16 -0000	1.4
+++ admin/xmldb/actions/template/template.class.php	9 Jun 2008 13:36:14 -0000
@@ -62,7 +62,7 @@
     /// Do the job, setting result as needed
     /// Get the dir containing the file
         $dirpath = required_param('dir', PARAM_PATH);
-        $dirpath = $CFG->dirroot . stripslashes_safe($dirpath);
+        $dirpath = $CFG->dirroot . $dirpath;
 
     /// Get the correct dirs
         if (!empty($XMLDB->dbdirs)) {
Index: admin/xmldb/actions/create_xml_file/create_xml_file.class.php
===================================================================
RCS file: /cvsroot/moodle/moodle/admin/xmldb/actions/create_xml_file/create_xml_file.class.php,v
retrieving revision 1.5
diff -u -r1.5 create_xml_file.class.php
--- admin/xmldb/actions/create_xml_file/create_xml_file.class.php	10 Oct 2007 05:25:28 -0000	1.5
+++ admin/xmldb/actions/create_xml_file/create_xml_file.class.php	9 Jun 2008 13:36:07 -0000
@@ -66,7 +66,7 @@
 
     /// Get the dir containing the file
         $dirpath = required_param('dir', PARAM_PATH);
-        $dirpath = $CFG->dirroot . stripslashes_safe($dirpath);
+        $dirpath = $CFG->dirroot . $dirpath;
         $file = $dirpath . '/install.xml';
 
     /// Some variables
Index: blocks/search/config_global.html
===================================================================
RCS file: /cvsroot/moodle/moodle/blocks/search/config_global.html,v
retrieving revision 1.7
diff -u -r1.7 config_global.html
--- blocks/search/config_global.html	2 Jun 2008 20:15:51 -0000	1.7
+++ blocks/search/config_global.html	9 Jun 2008 13:36:31 -0000
@@ -148,7 +148,7 @@
         <td valign="top" align="left">
             <input id="block_search_word_to_text_env" type="text" size="60" name="block_search_word_to_text_env" value="<?php 
             if(isset($CFG->block_search_word_to_text_env)) {
-                echo stripslashes($CFG->block_search_word_to_text_env);
+                echo $CFG->block_search_word_to_text_env;
             } else {
                 if ($CFG->ostype == 'WINDOWS'){
                     p("HOME={$CFG->dirroot}\\lib\\antiword\\win32");
@@ -196,7 +196,7 @@
             <input id="block_search_<?php p($type) ?>_to_text_env" type="text" size="60" name="block_search_<?php p($type) ?>_to_text_env" value="<?php 
             $propname = "block_search_{$type}_to_text_env";
             if(isset($CFG->$propname)) {
-                echo stripslashes($CFG->$propname);
+                echo $CFG->$propname;
             } ?>"/><br/><br/>
         </td>
     </tr>
Index: admin/xmldb/actions/view_table_xml/view_table_xml.class.php
===================================================================
RCS file: /cvsroot/moodle/moodle/admin/xmldb/actions/view_table_xml/view_table_xml.class.php,v
retrieving revision 1.4
diff -u -r1.4 view_table_xml.class.php
--- admin/xmldb/actions/view_table_xml/view_table_xml.class.php	10 Oct 2007 05:25:31 -0000	1.4
+++ admin/xmldb/actions/view_table_xml/view_table_xml.class.php	9 Jun 2008 13:36:16 -0000
@@ -65,7 +65,7 @@
         $select = required_param('select', PARAM_ALPHA); //original/edited
     /// Get the dir containing the file
         $dirpath = required_param('dir', PARAM_PATH);
-        $dirpath = $CFG->dirroot . stripslashes_safe($dirpath);
+        $dirpath = $CFG->dirroot . $dirpath;
 
     /// Get the correct dir
         if ($select == 'original') {
Index: lib/editor/tinymce/jscripts/tiny_mce/plugins/moodleimage/preview.php
===================================================================
RCS file: /cvsroot/moodle/moodle/lib/editor/tinymce/jscripts/tiny_mce/plugins/moodleimage/preview.php,v
retrieving revision 1.1
diff -u -r1.1 preview.php
--- lib/editor/tinymce/jscripts/tiny_mce/plugins/moodleimage/preview.php	9 May 2008 09:29:39 -0000	1.1
+++ lib/editor/tinymce/jscripts/tiny_mce/plugins/moodleimage/preview.php	9 Jun 2008 13:37:16 -0000
@@ -11,7 +11,7 @@
     @header('Content-Type: text/html; charset=utf-8');
 
 
-    $imagetag = clean_text('<img src="'.htmlSpecialChars(stripslashes_safe($imageurl)).'" alt="" />');
+    $imagetag = clean_text('<img src="'.htmlSpecialChars($imageurl).'" alt="" />');
 
 ?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
Index: enrol/paypal/ipn.php
===================================================================
RCS file: /cvsroot/moodle/moodle/enrol/paypal/ipn.php,v
retrieving revision 1.24
diff -u -r1.24 ipn.php
--- enrol/paypal/ipn.php	2 Jun 2008 21:02:53 -0000	1.24
+++ enrol/paypal/ipn.php	9 Jun 2008 13:36:37 -0000
@@ -31,7 +31,6 @@
     $data = new object();
 
     foreach ($_POST as $key => $value) {
-        $value = stripslashes($value);
         $req .= "&$key=".urlencode($value);
         $data->$key = $value;
     }
Index: question/format/coursetestmanager/format.php
===================================================================
RCS file: /cvsroot/moodle/moodle/question/format/coursetestmanager/format.php,v
retrieving revision 1.17
diff -u -r1.17 format.php
--- question/format/coursetestmanager/format.php	6 Jun 2008 14:43:17 -0000	1.17
+++ question/format/coursetestmanager/format.php	9 Jun 2008 13:37:56 -0000
@@ -67,18 +67,18 @@
 
             echo "<tr><td align=\"right\">";
             echo "What is the hostname or IP address of the ODBC Socket Server:</td><td>";
-            echo " <input name=\"hostname\" type=\"text\" size=\"50\" value=\"".stripslashes($hostname_access_error)."\" />";
+            echo " <input name=\"hostname\" type=\"text\" size=\"50\" value=\"".$hostname_access_error."\" />";
             echo " <input name=\"filename\" type=\"hidden\" value=\"".$filename."\" />";
             echo " <input name=\"category\" type=\"hidden\" value=\"".$category->id."\" />";
             echo " <input name=\"format\" type=\"hidden\" value=\"".$form->format."\" />";
             echo "</td><td>&nbsp;</td></tr>";
             echo "<tr><td align=\"right\">";
             echo "What is the location of the database (.mdb file) on the Socket Server:</td><td>";
-            echo " <input name=\"mdbpath\" type=\"text\" size=\"50\" value=\"".stripslashes($mdbpath)."\" />";
+            echo " <input name=\"mdbpath\" type=\"text\" size=\"50\" value=\"".$mdbpath."\" />";
             echo "</td><td>&nbsp;</td></tr>";
             echo "<tr><td align=\"right\">";
             echo "What is the location of the system database (System.mda file) on the Socket Server:</td><td>";
-            echo " <input name=\"mdapath\" type=\"text\" size=\"50\" value=\"".stripslashes($mdapath)."\" />";
+            echo " <input name=\"mdapath\" type=\"text\" size=\"50\" value=\"".$mdapath."\" />";
             echo "</td><td>&nbsp;</td></tr>";
             echo "<tr><td>&nbsp;</td><td>";
             echo " <input type=\"submit\" name=\"save\" value=\"Connect to Server\" />";
@@ -138,9 +138,9 @@
             echo " <input name=\"category\" type=\"hidden\" value=\"".$category->id."\" />";
             echo " <input name=\"format\" type=\"hidden\" value=\"".$form->format."\" />";
             if (PHP_OS == "Linux") {
-                echo " <input name=\"hostname\" type=\"hidden\" value=\"".stripslashes(trim($hostname))."\" />";
-                echo " <input name=\"mdbpath\" type=\"hidden\" value=\"".stripslashes($mdbpath)."\" />";
-                echo " <input name=\"mdapath\" type=\"hidden\" value=\"".stripslashes($mdapath)."\" />";
+                echo " <input name=\"hostname\" type=\"hidden\" value=\"".trim($hostname)."\" />";
+                echo " <input name=\"mdbpath\" type=\"hidden\" value=\"".$mdbpath."\" />";
+                echo " <input name=\"mdapath\" type=\"hidden\" value=\"".$mdapath."\" />";
             }
             echo "</td><td>&nbsp;</td>";
             echo "</tr><tr><td>&nbsp;</td><td>";
@@ -186,14 +186,14 @@
                 case 1:
                     $question->qtype = MULTICHOICE; // MULTICHOICE, SHORTANSWER, TRUEFALSE
         //          echo "<pre>";echo htmlspecialchars($qrec[2]); echo "</pre>";
-                    $question->questiontext = addslashes(trim($qrec[2]));
+                    $question->questiontext = trim($qrec[2]);
         //          echo "<pre>";echo $question->questiontext; echo "</pre>";
                     $question->name = preg_replace("/<br />/", "", $question->questiontext);
                     $question->single = 1;  // Only one answer is allowed -- used for multiple choicers
                     $fractionset = 0;
                     for ($i=4;$i<=7;$i++) {
                         if ($qrec[$i] != "") {
-                            $question->answer[$i-3]=addslashes($qrec[$i]);
+                            $question->answer[$i-3]=$qrec[$i];
                             if ($qrec[8] == $i-3) {  // if this is the index of CorrectAnswer
                                 $question->fraction[$i-3] = 1;
                                 $fractionset = 1;
@@ -209,7 +209,7 @@
                 break;
                 case 2:  // TRUE FALSE
                     $question->qtype = TRUEFALSE;
-                    $question->questiontext = addslashes(trim($qrec[2]));
+                    $question->questiontext = trim($qrec[2]);
                     $question->name = preg_replace("/<br />/", "", $question->questiontext);
                     // for TF, $question->answer should be 1 for true, 0 for false
                     if ($qrec[8] == "T") {
@@ -223,7 +223,7 @@
                 break;
                 case 3:
                     $question->qtype = SHORTANSWER;
-                    $question->questiontext = addslashes(trim($qrec[2]));
+                    $question->questiontext = trim($qrec[2]);
         //          echo "<pre>";echo $question->questiontext; echo "</pre>";
                     $question->name = preg_replace("/<br />/", "", $question->questiontext);
                     $question->usecase=0;  // Ignore case -- for SHORT ANSWER questions
@@ -231,7 +231,7 @@
                     $question->answer[0]=" ";
                     $question->fraction[0]=1;
                     for ($i=0;$i<count($answers);$i++) {
-                        $question->answer[$i] = addslashes(trim($answers[$i]));
+                        $question->answer[$i] = trim($answers[$i]);
                         $question->feedback[$i] = $ref;
                         $question->fraction[$i] = 1; // 1 for 100%, 0 for none or somewhere in between
                     }
@@ -257,7 +257,7 @@
         }
         foreach ($questions as $question) {   // Process and store each question
             $count++;
-            echo "<hr /><p><b>$count</b>. ".stripslashes($question->questiontext)."</p>";
+            echo "<hr /><p><b>$count</b>. ".$question->questiontext."</p>";
             $question->category = $this->category->id;
             $question->stamp = make_unique_id_code();  // Set the unique code (not to be changed)
             $question->createdby = $USER->id;
Index: admin/xmldb/actions/delete_xml_file/delete_xml_file.class.php
===================================================================
RCS file: /cvsroot/moodle/moodle/admin/xmldb/actions/delete_xml_file/delete_xml_file.class.php,v
retrieving revision 1.5
diff -u -r1.5 delete_xml_file.class.php
--- admin/xmldb/actions/delete_xml_file/delete_xml_file.class.php	10 Oct 2007 05:25:26 -0000	1.5
+++ admin/xmldb/actions/delete_xml_file/delete_xml_file.class.php	9 Jun 2008 13:36:08 -0000
@@ -64,7 +64,7 @@
 
     /// Get the dir containing the file
         $dirpath = required_param('dir', PARAM_CLEAN);
-        $dirpath = $CFG->dirroot . stripslashes_safe($dirpath);
+        $dirpath = $CFG->dirroot . $dirpath;
 
         $confirmed = optional_param('confirmed', false, PARAM_BOOL);
 
Index: mod/feedback/item/captcha/lib.php
===================================================================
RCS file: /cvsroot/moodle/moodle/mod/feedback/item/captcha/lib.php,v
retrieving revision 1.4
diff -u -r1.4 lib.php
--- mod/feedback/item/captcha/lib.php	7 Jun 2008 22:22:06 -0000	1.4
+++ mod/feedback/item/captcha/lib.php	9 Jun 2008 13:37:27 -0000
@@ -87,7 +87,7 @@
         $requiredmark = ($item->required == 1)?'<span class="feedback_required_mark">*</span>':'';
     ?>
         <td <?php echo $highlight;?> valign="top" align="<?php echo $align;?>">
-            <?php echo format_text(stripslashes_safe($item->name) . $requiredmark, true, false, false);?>
+            <?php echo format_text($item->name . $requiredmark, true, false, false);?>
             <img alt="<?php echo $this->type;?>" src="<?php echo $CFG->wwwroot.htmlspecialchars('/mod/feedback/item/captcha/print_captcha.php?id='.$cmid);?>" />
         </td>
         <td valign="top" align="<?php echo $align;?>">
@@ -123,7 +123,7 @@
     }
 
     function create_value($data) {
-        $data = addslashes(clean_text($data));
+        $data = clean_text($data);
         return $data;
     }
 
Index: notes/delete.php
===================================================================
RCS file: /cvsroot/moodle/moodle/notes/delete.php,v
retrieving revision 1.7
diff -u -r1.7 delete.php
--- notes/delete.php	31 May 2008 17:44:57 -0000	1.7
+++ notes/delete.php	9 Jun 2008 13:37:53 -0000
@@ -32,7 +32,7 @@
     print_error('You may not delete this note');
 }
 
-if (data_submitted(false) && confirm_sesskey()) {
+if (data_submitted() && confirm_sesskey()) {
 //if data was submitted and is valid, then delete note
     $returnurl = $CFG->wwwroot . '/notes/index.php?course=' . $course->id . '&amp;user=' . $note->userid;
     if (note_delete($noteid)) {
Index: notes/add.php
===================================================================
RCS file: /cvsroot/moodle/moodle/notes/add.php,v
retrieving revision 1.9
diff -u -r1.9 add.php
--- notes/add.php	31 May 2008 17:44:57 -0000	1.9
+++ notes/add.php	9 Jun 2008 13:37:53 -0000
@@ -39,7 +39,7 @@
     }
 
 /// if data was submitted and validated, then save it to database
-    if ($formdata = $noteform->get_data(false)) {
+    if ($formdata = $noteform->get_data()) {
         $note = new object();
         $note->courseid     = $formdata->course;
         $note->content      = $formdata->content;
@@ -55,7 +55,7 @@
 
     if ($noteform->is_submitted()) {
         // if data was submitted with errors, then use it as default for new form
-        $note = $noteform->get_submitted_data(false);
+        $note = $noteform->get_submitted_data();
     } else {
         // if data was not submitted yet, then use default values
         $note = new object();
Index: notes/edit.php
===================================================================
RCS file: /cvsroot/moodle/moodle/notes/edit.php,v
retrieving revision 1.9
diff -u -r1.9 edit.php
--- notes/edit.php	31 May 2008 17:44:57 -0000	1.9
+++ notes/edit.php	9 Jun 2008 13:37:53 -0000
@@ -60,7 +60,7 @@
 
     if ($noteform->is_submitted()) {
         // if data was submitted with errors, then use it as default for new form
-        $note = $noteform->get_submitted_data(false);
+        $note = $noteform->get_submitted_data();
     } else {
         // if data was not submitted yet, then used values retrieved from the database
         $note->user   = $note->userid;
Index: mod/chat/gui_header_js/insert.php
===================================================================
RCS file: /cvsroot/moodle/moodle/mod/chat/gui_header_js/insert.php,v
retrieving revision 1.12
diff -u -r1.12 insert.php
--- mod/chat/gui_header_js/insert.php	8 Jun 2008 15:49:37 -0000	1.12
+++ mod/chat/gui_header_js/insert.php	9 Jun 2008 13:37:21 -0000
@@ -36,7 +36,7 @@
 
 /// Clean up the message
 
-    $chat_message = clean_text(stripslashes($chat_message), FORMAT_MOODLE);  // Strip bad tags
+    $chat_message = clean_text($chat_message, FORMAT_MOODLE);  // Strip bad tags
 
 /// Add the message to the database
 
Index: admin/xmldb/actions/new_sentence/new_sentence.class.php
===================================================================
RCS file: /cvsroot/moodle/moodle/admin/xmldb/actions/new_sentence/new_sentence.class.php,v
retrieving revision 1.4
diff -u -r1.4 new_sentence.class.php
--- admin/xmldb/actions/new_sentence/new_sentence.class.php	10 Oct 2007 05:25:19 -0000	1.4
+++ admin/xmldb/actions/new_sentence/new_sentence.class.php	9 Jun 2008 13:36:13 -0000
@@ -64,7 +64,7 @@
     /// Do the job, setting result as needed
     /// Get the dir containing the file
         $dirpath = required_param('dir', PARAM_PATH);
-        $dirpath = $CFG->dirroot . stripslashes_safe($dirpath);
+        $dirpath = $CFG->dirroot . $dirpath;
 
     /// Get the correct dirs
         if (!empty($XMLDB->dbdirs)) {
Index: admin/xmldb/actions/move_updown_table/move_updown_table.class.php
===================================================================
RCS file: /cvsroot/moodle/moodle/admin/xmldb/actions/move_updown_table/move_updown_table.class.php,v
retrieving revision 1.4
diff -u -r1.4 move_updown_table.class.php
--- admin/xmldb/actions/move_updown_table/move_updown_table.class.php	10 Oct 2007 05:25:25 -0000	1.4
+++ admin/xmldb/actions/move_updown_table/move_updown_table.class.php	9 Jun 2008 13:36:12 -0000
@@ -62,7 +62,7 @@
     /// Do the job, setting result as needed
     /// Get the dir containing the file
         $dirpath = required_param('dir', PARAM_PATH);
-        $dirpath = $CFG->dirroot . stripslashes_safe($dirpath);
+        $dirpath = $CFG->dirroot . $dirpath;
 
     /// Get the correct dirs
         if (!empty($XMLDB->dbdirs)) {
Index: question/type/multichoice/questiontype.php
===================================================================
RCS file: /cvsroot/moodle/moodle/question/type/multichoice/questiontype.php,v
retrieving revision 1.35
diff -u -r1.35 questiontype.php
--- question/type/multichoice/questiontype.php	6 Jun 2008 14:43:17 -0000	1.35
+++ question/type/multichoice/questiontype.php	9 Jun 2008 13:38:04 -0000
@@ -575,9 +575,9 @@
                 if ($correctfeedback != $multichoice->correctfeedback ||
                         $partiallycorrectfeedback != $multichoice->partiallycorrectfeedback ||
                         $incorrectfeedback != $multichoice->incorrectfeedback) {
-                    $subquestion->correctfeedback = addslashes($correctfeedback);
-                    $subquestion->partiallycorrectfeedback = addslashes($partiallycorrectfeedback);
-                    $subquestion->incorrectfeedback = addslashes($incorrectfeedback);
+                    $subquestion->correctfeedback = $correctfeedback;
+                    $subquestion->partiallycorrectfeedback = $partiallycorrectfeedback;
+                    $subquestion->incorrectfeedback = $incorrectfeedback;
                     if (!$DB->update_record('question_multichoice', $multichoice)) {
                         $status = false;
                     }
Index: mod/glossary/import.php
===================================================================
RCS file: /cvsroot/moodle/moodle/mod/glossary/import.php,v
retrieving revision 1.48
diff -u -r1.48 import.php
--- mod/glossary/import.php	8 Jun 2008 10:43:40 -0000	1.48
+++ mod/glossary/import.php	9 Jun 2008 13:37:37 -0000
@@ -194,12 +194,12 @@
             // Inserting the entries
             $xmlentry = $xmlentries[$i];
             unset($newentry);
-            $newentry->concept = trim(addslashes($xmlentry['#']['CONCEPT'][0]['#']));
-            $newentry->definition = trusttext_strip(addslashes($xmlentry['#']['DEFINITION'][0]['#']));
+            $newentry->concept = trim($xmlentry['#']['CONCEPT'][0]['#']);
+            $newentry->definition = trusttext_strip($xmlentry['#']['DEFINITION'][0]['#']);
             if ( isset($xmlentry['#']['CASESENSITIVE'][0]['#']) ) {
-                $newentry->casesensitive    = addslashes($xmlentry['#']['CASESENSITIVE'][0]['#']);
+                $newentry->casesensitive = $xmlentry['#']['CASESENSITIVE'][0]['#'];
             } else {
-                $newentry->casesensitive      = $CFG->glossary_casesensitive;
+                $newentry->casesensitive = $CFG->glossary_casesensitive;
             }
 
             $permissiongranted = 1;
Index: mod/glossary/edit.php
===================================================================
RCS file: /cvsroot/moodle/moodle/mod/glossary/edit.php,v
retrieving revision 1.82
diff -u -r1.82 edit.php
--- mod/glossary/edit.php	8 Jun 2008 10:43:39 -0000	1.82
+++ mod/glossary/edit.php	9 Jun 2008 13:37:36 -0000
@@ -55,7 +55,7 @@
         redirect("view.php?id=$cm->id");
     }
 
-} elseif ($fromform = $mform->get_data(false)) {
+} elseif ($fromform = $mform->get_data()) {
     trusttext_after_edit($fromform->definition, $context);
 
     if ( !isset($fromform->usedynalink) ) {
Index: mod/glossary/rate.php
===================================================================
RCS file: /cvsroot/moodle/moodle/mod/glossary/rate.php,v
retrieving revision 1.15
diff -u -r1.15 rate.php
--- mod/glossary/rate.php	8 Jun 2008 10:43:39 -0000	1.15
+++ mod/glossary/rate.php	9 Jun 2008 13:37:37 -0000
@@ -42,7 +42,7 @@
         $returnurl = $CFG->wwwroot.'/mod/glossary/view.php?id='.$cm->id;
     }
 
-    if ($data = data_submitted(false)) {    // form submitted
+    if ($data = data_submitted()) {    // form submitted
         foreach ((array)$data as $entryid => $rating) {
             if (!is_numeric($entryid)) {
                 continue;
Index: mod/glossary/comment.php
===================================================================
RCS file: /cvsroot/moodle/moodle/mod/glossary/comment.php,v
retrieving revision 1.47
diff -u -r1.47 comment.php
--- mod/glossary/comment.php	8 Jun 2008 10:43:39 -0000	1.47
+++ mod/glossary/comment.php	9 Jun 2008 13:37:36 -0000
@@ -59,7 +59,7 @@
         redirect("comments.php?id=$cm->id&amp;eid=$entry->id");
     }
 
-    if ($data = $mform->get_data(false)) {
+    if ($data = $mform->get_data()) {
         trusttext_after_edit($data->entrycomment, $context);
 
         $newcomment = new object();
@@ -179,7 +179,7 @@
     trusttext_prepare_edit($comment->entrycomment, $comment->format, can_use_html_editor(), $context);
     $mform->set_data(array('cid'=>$cid, 'action'=>'edit', 'entrycomment'=>$comment->entrycomment, 'format'=>$comment->format));
 
-    if ($data = $mform->get_data(false)) {
+    if ($data = $mform->get_data()) {
         trusttext_after_edit($data->entrycomment, $context);
 
         $updatedcomment = new object();
Index: files/index.php
===================================================================
RCS file: /cvsroot/moodle/moodle/files/index.php,v
retrieving revision 1.130
diff -u -r1.130 index.php
--- files/index.php	31 May 2008 18:05:44 -0000	1.130
+++ files/index.php	9 Jun 2008 13:36:38 -0000
@@ -409,7 +409,7 @@
             if (($text != '') and confirm_sesskey()) {
                 $fileptr = fopen($basedir.'/'.$file,"w");
                 $text = preg_replace('/\x0D/', '', $text);  // http://moodle.org/mod/forum/discuss.php?d=38860
-                fputs($fileptr, stripslashes($text));
+                fputs($fileptr, $text);
                 fclose($fileptr);
                 displaydir($wdir);
 
Index: admin/xmldb/actions/load_xml_file/load_xml_file.class.php
===================================================================
RCS file: /cvsroot/moodle/moodle/admin/xmldb/actions/load_xml_file/load_xml_file.class.php,v
retrieving revision 1.9
diff -u -r1.9 load_xml_file.class.php
--- admin/xmldb/actions/load_xml_file/load_xml_file.class.php	20 May 2008 17:06:26 -0000	1.9
+++ admin/xmldb/actions/load_xml_file/load_xml_file.class.php	9 Jun 2008 13:36:12 -0000
@@ -66,7 +66,7 @@
 
     /// Get the dir containing the file
         $dirpath = required_param('dir', PARAM_PATH);
-        $dirpath = $CFG->dirroot . stripslashes_safe($dirpath);
+        $dirpath = $CFG->dirroot . $dirpath;
 
     /// Get the correct dir
         if (!empty($XMLDB->dbdirs)) {
Index: admin/xmldb/actions/new_field/new_field.class.php
===================================================================
RCS file: /cvsroot/moodle/moodle/admin/xmldb/actions/new_field/new_field.class.php,v
retrieving revision 1.6
diff -u -r1.6 new_field.class.php
--- admin/xmldb/actions/new_field/new_field.class.php	20 May 2008 23:24:41 -0000	1.6
+++ admin/xmldb/actions/new_field/new_field.class.php	9 Jun 2008 13:36:13 -0000
@@ -62,7 +62,7 @@
     /// Do the job, setting result as needed
     /// Get the dir containing the file
         $dirpath = required_param('dir', PARAM_PATH);
-        $dirpath = $CFG->dirroot . stripslashes_safe($dirpath);
+        $dirpath = $CFG->dirroot . $dirpath;
 
     /// Get the correct dirs
         if (!empty($XMLDB->dbdirs)) {
Index: admin/xmldb/actions/edit_table/edit_table.class.php
===================================================================
RCS file: /cvsroot/moodle/moodle/admin/xmldb/actions/edit_table/edit_table.class.php,v
retrieving revision 1.6
diff -u -r1.6 edit_table.class.php
--- admin/xmldb/actions/edit_table/edit_table.class.php	15 May 2008 21:40:12 -0000	1.6
+++ admin/xmldb/actions/edit_table/edit_table.class.php	9 Jun 2008 13:36:11 -0000
@@ -77,7 +77,7 @@
     /// Do the job, setting result as needed
     /// Get the dir containing the file
         $dirpath = required_param('dir', PARAM_PATH);
-        $dirpath = $CFG->dirroot . stripslashes_safe($dirpath);
+        $dirpath = $CFG->dirroot . $dirpath;
 
     /// Get the correct dirs
         if (!empty($XMLDB->dbdirs)) {
Index: mod/survey/report.php
===================================================================
RCS file: /cvsroot/moodle/moodle/mod/survey/report.php,v
retrieving revision 1.58
diff -u -r1.58 report.php
--- mod/survey/report.php	8 Jun 2008 14:43:39 -0000	1.58
+++ mod/survey/report.php	9 Jun 2008 13:37:49 -0000
@@ -11,8 +11,6 @@
     $student = optional_param('student', 0, PARAM_INT);   // Student ID
     $notes   = optional_param('notes', '', PARAM_RAW);    // Save teachers notes
 
-    $notes = stripslashes($notes); // TODO: remove soon
-
     $qids = explode(',', $qid);
     $qids = clean_param($qids, PARAM_INT);
     $qid = implode (',', $qids);
Index: mod/survey/save.php
===================================================================
RCS file: /cvsroot/moodle/moodle/mod/survey/save.php,v
retrieving revision 1.30
diff -u -r1.30 save.php
--- mod/survey/save.php	8 Jun 2008 14:43:39 -0000	1.30
+++ mod/survey/save.php	9 Jun 2008 13:37:49 -0000
@@ -6,7 +6,7 @@
 
 // Make sure this is a legitimate posting
 
-    if (!$formdata = data_submitted(false)) {
+    if (!$formdata = data_submitted()) {
         print_error("You are not supposed to use this script like that.");
     }
 
Index: question/format/missingword/format.php
===================================================================
RCS file: /cvsroot/moodle/moodle/question/format/missingword/format.php,v
retrieving revision 1.3
diff -u -r1.3 format.php
--- question/format/missingword/format.php	20 Mar 2007 02:24:15 -0000	1.3
+++ question/format/missingword/format.php	9 Jun 2008 13:37:58 -0000
@@ -67,7 +67,7 @@
         $answertext = substr($text, $answerstart + 1, $answerlength - 1);
 
         /// Save the new question text
-        $question->questiontext = addslashes(substr_replace($text, "_____", $answerstart, $answerlength+1));
+        $question->questiontext = substr_replace($text, "_____", $answerstart, $answerlength+1);
         $question->name = $question->questiontext;
 
 
@@ -97,7 +97,7 @@
                 if ($answer[0] == "=") {
                     $answer = substr($answer, 1);
                 }
-                $question->answer[]   = addslashes($answer);
+                $question->answer[]   = $answer;
                 $question->fraction[] = 1;
                 $question->feedback[] = "";
     
@@ -130,7 +130,7 @@
 
                     if (strpos($answer,"#") > 0){
                         $hashpos = strpos($answer,"#");
-                        $comment = addslashes(substr(($answer),$hashpos+1));
+                        $comment = substr(($answer),$hashpos+1);
                         $answer  = substr($answer,0,$hashpos);
                     } else {
                         $comment = " ";
@@ -145,7 +145,7 @@
 #                       $question->fraction[$key] = 0;
                         $question->fraction[$key] = $answeight;
                     }
-                    $question->answer[$key]   = addslashes($answer);
+                    $question->answer[$key]   = $answer;
                     $question->feedback[$key] = $comment;
                 }
     
Index: grade/edit/outcome/course.php
===================================================================
RCS file: /cvsroot/moodle/moodle/grade/edit/outcome/course.php,v
retrieving revision 1.9
diff -u -r1.9 course.php
--- grade/edit/outcome/course.php	3 Jun 2008 16:10:59 -0000	1.9
+++ grade/edit/outcome/course.php	9 Jun 2008 13:36:39 -0000
@@ -105,7 +105,7 @@
 
 
 /// form processing
-if ($data = data_submitted(false)) {
+if ($data = data_submitted()) {
     require_capability('moodle/grade:manageoutcomes', $context);
     if (!empty($data->add) && !empty($data->addoutcomes)) {
     /// add all selected to course list
Index: grade/edit/outcome/edit.php
===================================================================
RCS file: /cvsroot/moodle/moodle/grade/edit/outcome/edit.php,v
retrieving revision 1.7
diff -u -r1.7 edit.php
--- grade/edit/outcome/edit.php	2 Jun 2008 16:06:33 -0000	1.7
+++ grade/edit/outcome/edit.php	9 Jun 2008 13:36:39 -0000
@@ -92,7 +92,7 @@
 if ($mform->is_cancelled()) {
     redirect($returnurl);
 
-} else if ($data = $mform->get_data(false)) {
+} else if ($data = $mform->get_data()) {
     $outcome = new grade_outcome(array('id'=>$id));
     $data->usermodified = $USER->id;
     grade_outcome::set_properties($outcome, $data);
Index: grade/edit/outcome/index.php
===================================================================
RCS file: /cvsroot/moodle/moodle/grade/edit/outcome/index.php,v
retrieving revision 1.20
diff -u -r1.20 index.php
--- grade/edit/outcome/index.php	3 Jun 2008 16:10:59 -0000	1.20
+++ grade/edit/outcome/index.php	9 Jun 2008 13:36:39 -0000
@@ -56,7 +56,7 @@
 require_once('import_outcomes_form.php');
 $upload_form = new import_outcomes_form();
 
-if ($upload_form_data = $upload_form->get_data(false)) {
+if ($upload_form_data = $upload_form->get_data()) {
     require_once('import.php');
     exit();
 }
Index: admin/xmldb/actions/move_updown_statement/move_updown_statement.class.php
===================================================================
RCS file: /cvsroot/moodle/moodle/admin/xmldb/actions/move_updown_statement/move_updown_statement.class.php,v
retrieving revision 1.4
diff -u -r1.4 move_updown_statement.class.php
--- admin/xmldb/actions/move_updown_statement/move_updown_statement.class.php	10 Oct 2007 05:25:28 -0000	1.4
+++ admin/xmldb/actions/move_updown_statement/move_updown_statement.class.php	9 Jun 2008 13:36:12 -0000
@@ -62,7 +62,7 @@
     /// Do the job, setting result as needed
     /// Get the dir containing the file
         $dirpath = required_param('dir', PARAM_PATH);
-        $dirpath = $CFG->dirroot . stripslashes_safe($dirpath);
+        $dirpath = $CFG->dirroot . $dirpath;
 
     /// Get the correct dirs
         if (!empty($XMLDB->dbdirs)) {
Index: admin/xmldb/actions/move_updown_index/move_updown_index.class.php
===================================================================
RCS file: /cvsroot/moodle/moodle/admin/xmldb/actions/move_updown_index/move_updown_index.class.php,v
retrieving revision 1.4
diff -u -r1.4 move_updown_index.class.php
--- admin/xmldb/actions/move_updown_index/move_updown_index.class.php	10 Oct 2007 05:25:17 -0000	1.4
+++ admin/xmldb/actions/move_updown_index/move_updown_index.class.php	9 Jun 2008 13:36:12 -0000
@@ -62,7 +62,7 @@
     /// Do the job, setting result as needed
     /// Get the dir containing the file
         $dirpath = required_param('dir', PARAM_PATH);
-        $dirpath = $CFG->dirroot . stripslashes_safe($dirpath);
+        $dirpath = $CFG->dirroot . $dirpath;
 
     /// Get the correct dirs
         if (!empty($XMLDB->dbdirs)) {
Index: mod/lesson/action/updatepage.php
===================================================================
RCS file: /cvsroot/moodle/moodle/mod/lesson/action/updatepage.php,v
retrieving revision 1.19
diff -u -r1.19 updatepage.php
--- mod/lesson/action/updatepage.php	6 Jun 2008 04:03:40 -0000	1.19
+++ mod/lesson/action/updatepage.php	9 Jun 2008 13:37:45 -0000
@@ -45,7 +45,7 @@
     }
     $page->title = clean_param($form->title, PARAM_CLEANHTML);
     $page->contents = trim($form->contents);
-    $page->title = addslashes($page->title);
+    $page->title = $page->title;
     
     if (!$DB->update_record("lesson_pages", $page)) {
         print_error("Update page: page not updated");
Index: mod/lesson/action/continue.php
===================================================================
RCS file: /cvsroot/moodle/moodle/mod/lesson/action/continue.php,v
retrieving revision 1.48
diff -u -r1.48 continue.php
--- mod/lesson/action/continue.php	9 Jun 2008 12:29:40 -0000	1.48
+++ mod/lesson/action/continue.php	9 Jun 2008 13:37:45 -0000
@@ -83,17 +83,16 @@
             $userresponse->score = 0;
             $userresponse->answer = $useranswer;
             $userresponse->response = "";
-            $userresponse = addslashes(serialize($userresponse));
+            $userresponse = serialize($userresponse);
             
-            $studentanswer = s(stripslashes_safe($useranswer));
+            $studentanswer = s($useranswer);
             break;
          case LESSON_SHORTANSWER :
             if (!$useranswer = $_POST['answer']) {
                 $noanswer = true;
                 break;
             }            
-            $useranswer = s(stripslashes(clean_param($useranswer, PARAM_RAW)));
-            $userresponse = addslashes($useranswer);
+            $useranswer = s(clean_param($useranswer, PARAM_RAW));
             if (!$answers = $DB->get_records("lesson_answers", array("pageid" => $pageid), "id")) {
                 print_error("Continue: No answers found");
             }
@@ -367,7 +366,7 @@
             if (isset($_POST['response']) && is_array($_POST['response'])) { // only arrays should be submitted
                 $response = array();
                 foreach ($_POST['response'] as $key => $value) {
-                    $response[$key] = stripslashes($value);
+                    $response[$key] = $value;
                 }
             } else {
                 $noanswer = true;
Index: mod/lesson/action/insertpage.php
===================================================================
RCS file: /cvsroot/moodle/moodle/mod/lesson/action/insertpage.php,v
retrieving revision 1.14
diff -u -r1.14 insertpage.php
--- mod/lesson/action/insertpage.php	6 Jun 2008 04:03:40 -0000	1.14
+++ mod/lesson/action/insertpage.php	9 Jun 2008 13:37:45 -0000
@@ -45,7 +45,7 @@
         }
         $newpage->title = clean_param($form->title, PARAM_CLEANHTML);
         $newpage->contents = trim($form->contents);
-        $newpage->title = addslashes($newpage->title);
+        $newpage->title = $newpage->title;
         $newpageid = $DB->insert_record("lesson_pages", $newpage);
         if (!$newpageid) {
             print_error("Insert page: new page not inserted");
@@ -88,7 +88,7 @@
             }                
             $newpage->title = clean_param($form->title, PARAM_CLEANHTML);
             $newpage->contents = trim($form->contents);
-            $newpage->title = addslashes($newpage->title);
+            $newpage->title = $newpage->title;
             $newpageid = $DB->insert_record("lesson_pages", $newpage);
             if (!$newpageid) {
                 print_error("Insert page: new first page not inserted");
@@ -117,7 +117,7 @@
             }                
             $newpage->title = clean_param($form->title, PARAM_CLEANHTML);
             $newpage->contents = trim($form->contents);
-            $newpage->title = addslashes($newpage->title);
+            $newpage->title = $newpage->title;
             $newpageid = $DB->insert_record("lesson_pages", $newpage);
             if (!$newpageid) {
                 print_error("Insert page: first page not inserted");
Index: admin/xmldb/actions/view_structure_xml/view_structure_xml.class.php
===================================================================
RCS file: /cvsroot/moodle/moodle/admin/xmldb/actions/view_structure_xml/view_structure_xml.class.php,v
retrieving revision 1.4
diff -u -r1.4 view_structure_xml.class.php
--- admin/xmldb/actions/view_structure_xml/view_structure_xml.class.php	10 Oct 2007 05:25:22 -0000	1.4
+++ admin/xmldb/actions/view_structure_xml/view_structure_xml.class.php	9 Jun 2008 13:36:15 -0000
@@ -64,7 +64,7 @@
         $select = required_param('select', PARAM_ALPHA); //original/edited
     /// Get the dir containing the file
         $dirpath = required_param('dir', PARAM_PATH);
-        $dirpath = $CFG->dirroot . stripslashes_safe($dirpath);
+        $dirpath = $CFG->dirroot . $dirpath;
 
     /// Get the correct dir
         if ($select == 'original') {
Index: group/assign.php
===================================================================
RCS file: /cvsroot/moodle/moodle/group/assign.php,v
retrieving revision 1.22
diff -u -r1.22 assign.php
--- group/assign.php	1 Jun 2008 13:09:04 -0000	1.22
+++ group/assign.php	9 Jun 2008 13:36:43 -0000
@@ -24,7 +24,7 @@
 $returnurl = $CFG->wwwroot.'/group/groupings.php?id='.$courseid;
 
 
-if ($frm = data_submitted(false) and confirm_sesskey()) {
+if ($frm = data_submitted() and confirm_sesskey()) {
 
     if (isset($frm->cancel)) {
         redirect($returnurl);
Index: group/autogroup.php
===================================================================
RCS file: /cvsroot/moodle/moodle/group/autogroup.php,v
retrieving revision 1.8
diff -u -r1.8 autogroup.php
--- group/autogroup.php	1 Jun 2008 13:09:04 -0000	1.8
+++ group/autogroup.php	9 Jun 2008 13:36:43 -0000
@@ -69,7 +69,7 @@
 if ($editform->is_cancelled()) {
     redirect($returnurl);
 
-} elseif ($data = $editform->get_data(false)) {
+} elseif ($data = $editform->get_data()) {
 
     /// Allocate members from the selected role to groups
     switch ($data->allocateby) {
@@ -190,7 +190,7 @@
                 $grouping = new object();
                 $grouping->courseid = $COURSE->id;
                 $grouping->name     = $groupingname;
-                if (!$grouping->id = groups_create_grouping(addslashes_recursive($grouping))) {
+                if (!$grouping->id = groups_create_grouping($grouping)) {
                     $error = 'Can not create grouping'; //should not happen
                     $failed = true;
                 }
@@ -210,7 +210,7 @@
             $newgroup = new object();
             $newgroup->courseid = $data->courseid;
             $newgroup->name     = $group['name'];
-            if (!$groupid = groups_create_group(addslashes_recursive($newgroup))) {
+            if (!$groupid = groups_create_group($newgroup)) {
                 $error = 'Can not create group!'; // should not happen
                 $failed = true;
                 break;
Index: group/members.php
===================================================================
RCS file: /cvsroot/moodle/moodle/group/members.php,v
retrieving revision 1.10
diff -u -r1.10 members.php
--- group/members.php	1 Jun 2008 13:09:04 -0000	1.10
+++ group/members.php	9 Jun 2008 13:36:44 -0000
@@ -17,8 +17,6 @@
 $searchtext = optional_param('searchtext', '', PARAM_RAW); // search string
 $showall    = optional_param('showall', 0, PARAM_BOOL);
 
-$searchtext = stripslashes($searchtext); // TODO: remove soon
-
 if ($showall) {
     $searchtext = '';
 }
Index: mod/feedback/item/label/lib.php
===================================================================
RCS file: /cvsroot/moodle/moodle/mod/feedback/item/label/lib.php,v
retrieving revision 1.2
diff -u -r1.2 lib.php
--- mod/feedback/item/label/lib.php	28 Apr 2008 09:58:27 -0000	1.2
+++ mod/feedback/item/label/lib.php	9 Jun 2008 13:37:27 -0000
@@ -35,7 +35,7 @@
     //used by create_item and update_item functions,
     //when provided $data submitted from feedback_show_edit
     function get_presentation($data) {
-        return stripslashes($data->presentation);
+        return $data->presentation;
     }
 
     function get_hasvalue() {
Index: question/type/numerical/questiontype.php
===================================================================
RCS file: /cvsroot/moodle/moodle/question/type/numerical/questiontype.php,v
retrieving revision 1.23
diff -u -r1.23 questiontype.php
--- question/type/numerical/questiontype.php	6 Jun 2008 14:43:17 -0000	1.23
+++ question/type/numerical/questiontype.php	9 Jun 2008 13:38:04 -0000
@@ -245,7 +245,7 @@
             return true;
         }
 
-        $response = $this->apply_unit(stripslashes($state->responses['']), $question->options->units);
+        $response = $this->apply_unit($state->responses[''], $question->options->units);
 
         if ($response === false) {
             return false; // The student did not type a number.
Index: auth/mnet/auth.php
===================================================================
RCS file: /cvsroot/moodle/moodle/auth/mnet/auth.php,v
retrieving revision 1.40
diff -u -r1.40 auth.php
--- auth/mnet/auth.php	5 Jun 2008 14:17:26 -0000	1.40
+++ auth/mnet/auth.php	9 Jun 2008 13:36:18 -0000
@@ -906,9 +906,6 @@
         global $MNET_REMOTE_CLIENT, $CFG, $DB;
 
         $CFG->usesid = true;
-        // Addslashes to all usernames, so we can build the query string real
-        // simply with 'implode'
-        $array = array_map('addslashes', $array);
 
         // We don't want to output anything to the client machine
         $start = ob_start();
Index: grade/import/xml/index.php
===================================================================
RCS file: /cvsroot/moodle/moodle/grade/import/xml/index.php,v
retrieving revision 1.23
diff -u -r1.23 index.php
--- grade/import/xml/index.php	3 Jun 2008 16:10:59 -0000	1.23
+++ grade/import/xml/index.php	9 Jun 2008 13:36:42 -0000
@@ -49,7 +49,7 @@
 
 $mform = new grade_import_form();
 
-if ($data = $mform->get_data(false)) {
+if ($data = $mform->get_data()) {
     // Large files are likely to take their time and memory. Let PHP know
     // that we'll take longer, and that the process should be recycled soon
     // to free up memory.
Index: mod/hotpot/report/overview/report.php
===================================================================
RCS file: /cvsroot/moodle/moodle/mod/hotpot/report/overview/report.php,v
retrieving revision 1.13
diff -u -r1.13 report.php
--- mod/hotpot/report/overview/report.php	22 Oct 2007 01:48:15 -0000	1.13
+++ mod/hotpot/report/overview/report.php	9 Jun 2008 13:37:40 -0000
@@ -120,16 +120,16 @@
 			$table->finish = '<center>'."\n";
 			$table->finish .= '<input type="submit" value="'.get_string("deleteselected").'" />&nbsp;'."\n";
 			if ($abandoned) {
-				$table->finish .= '<input type="button" value="'.get_string('deleteabandoned', 'hotpot').'" onClick="if(deletecheck('."'".addslashes(get_string('deleteabandonedcheck', 'hotpot', $abandoned))."', 'abandoned', true".')) document.getElementById(\'deleteform\').submit();" />'."\n";
+				$table->finish .= '<input type="button" value="'.get_string('deleteabandoned', 'hotpot').'" onClick="if(deletecheck('."'".addslashes_js(get_string('deleteabandonedcheck', 'hotpot', $abandoned))."', 'abandoned', true".')) document.getElementById(\'deleteform\').submit();" />'."\n";
 			}
-			$table->finish .= '<input type="button" value="'.get_string("deleteall").'" onClick="if(deletecheck('."'".addslashes($strdeletecheck)."', 'all', true".'))document.getElementById(\'deleteform\').submit();" />'."\n";
+			$table->finish .= '<input type="button" value="'.get_string("deleteall").'" onClick="if(deletecheck('."'".addslashes_js($strdeletecheck)."', 'all', true".'))document.getElementById(\'deleteform\').submit();" />'."\n";
 			$table->finish .= '</center>'."\n";
 			$table->finish .= '</form>'."\n";
 		}
 		$tables[] = &$table;
 	}
 	function deleteform_javascript() {
-		$strselectattempt = addslashes(get_string('selectattempt','hotpot'));
+		$strselectattempt = addslashes_js(get_string('selectattempt','hotpot'));
 		return <<<END_OF_JAVASCRIPT
 <script type="text/javascript">
 <!--
Index: enrol/manual/enrol.php
===================================================================
RCS file: /cvsroot/moodle/moodle/enrol/manual/enrol.php,v
retrieving revision 1.34
diff -u -r1.34 enrol.php
--- enrol/manual/enrol.php	2 Jun 2008 21:02:53 -0000	1.34
+++ enrol/manual/enrol.php	9 Jun 2008 13:36:37 -0000
@@ -146,7 +146,7 @@
 
     $groupid = $this->check_group_entry($course->id, $form->password);
 
-    if ((stripslashes($form->password) == $course->password) or ($groupid !== false) ) {
+    if (($form->password == $course->password) or ($groupid !== false) ) {
 
         if (isguestuser()) { // only real user guest, do not use this for users with guest role
             $USER->enrolkey[$course->id] = true;
@@ -191,7 +191,7 @@
 
     if ($groups = groups_get_all_groups($courseid)) {
         foreach ($groups as $group) {
-            if ( !empty($group->enrolmentkey) and (stripslashes($password) == $group->enrolmentkey) ) {
+            if ( !empty($group->enrolmentkey) and ($password == $group->enrolmentkey) ) {
                 return $group->id;
             }
         }
Index: message/send.php
===================================================================
RCS file: /cvsroot/moodle/moodle/message/send.php,v
retrieving revision 1.28
diff -u -r1.28 send.php
--- message/send.php	5 Jun 2008 13:26:41 -0000	1.28
+++ message/send.php	9 Jun 2008 13:37:17 -0000
@@ -66,7 +66,7 @@
     if ($message!='' and confirm_sesskey()) {   /// Current user has just sent a message
 
     /// Save it to the database...
-        $messageid = message_post_message($USER, $user, addslashes($message), $format, 'direct');
+        $messageid = message_post_message($USER, $user, $message, $format, 'direct');
 
     /// Format the message as HTML
         $options = NULL;
Index: message/lib.php
===================================================================
RCS file: /cvsroot/moodle/moodle/message/lib.php,v
retrieving revision 1.75
diff -u -r1.75 lib.php
--- message/lib.php	5 Jun 2008 13:55:37 -0000	1.75
+++ message/lib.php	9 Jun 2008 13:37:17 -0000
@@ -179,7 +179,7 @@
 function message_print_search() {
     global $USER;
 
-    if ($frm = data_submitted(false)) {
+    if ($frm = data_submitted()) {
 
         message_print_search_results($frm);
 
@@ -203,7 +203,7 @@
 function message_print_settings() {
     global $USER;
 
-    if ($frm = data_submitted(false)) {
+    if ($frm = data_submitted()) {
 
         $pref = array();
         $pref['message_showmessagewindow'] = (isset($frm->showmessagewindow)) ? '1' : '0';
@@ -985,7 +985,6 @@
         }
         if ($emailforced || (time() - $userto->lastaccess) > ((int)$preference->message_emailtimenosee * 60)) { // Long enough
 
-            $message = stripslashes_safe($message);
             $tagline = get_string('emailtagline', 'message', $SITE->shortname);
 
             $messagesubject = preg_replace('/\s+/', ' ', strip_tags($message)); // make sure it's all on one line
Index: question/type/questiontype.php
===================================================================
RCS file: /cvsroot/moodle/moodle/question/type/questiontype.php,v
retrieving revision 1.86
diff -u -r1.86 questiontype.php
--- question/type/questiontype.php	9 Jun 2008 10:00:37 -0000	1.86
+++ question/type/questiontype.php	9 Jun 2008 13:38:03 -0000
@@ -634,7 +634,7 @@
         if ($question->options->answers) {
             foreach ($question->options->answers as $answer) {
                 if (((int) $answer->fraction) === 1) {
-                    return array('' => addslashes($answer->answer));
+                    return array('' => $answer->answer);
                 }
             }
         }
@@ -691,7 +691,7 @@
     // ULPGC ecastro
     function get_actual_response($question, $state) {
        if (!empty($state->responses)) {
-           $responses[] = stripslashes($state->responses['']);
+           $responses[] = $state->responses[''];
        } else {
            $responses[] = '';
        }
@@ -851,7 +851,7 @@
             $grade .= $question->maxgrade;
         }
 
-        $comment = stripslashes($state->manualcomment);
+        $comment = $state->manualcomment;
         $commentlink = '';
 
         if (isset($options->questioncommentlink) && $context && has_capability('mod/quiz:grade', $context)) {
Index: grade/export/xml/index.php
===================================================================
RCS file: /cvsroot/moodle/moodle/grade/export/xml/index.php,v
retrieving revision 1.39
diff -u -r1.39 index.php
--- grade/export/xml/index.php	3 Jun 2008 16:11:00 -0000	1.39
+++ grade/export/xml/index.php	9 Jun 2008 13:36:41 -0000
@@ -54,7 +54,7 @@
 $mform = new grade_export_form(null, array('idnumberrequired'=>true, 'publishing'=>true, 'updategradesonly'=>true));
 
 // process post information
-if ($data = $mform->get_data(false)) {
+if ($data = $mform->get_data()) {
     $export = new grade_export_xml($course, groups_get_course_group($course), '', false, $data->updatedgradesonly, $data->display, $data->decimals);
 
     // print the grades on screen for feedbacks
Index: admin/xmldb/actions/new_table_from_mysql/new_table_from_mysql.class.php
===================================================================
RCS file: /cvsroot/moodle/moodle/admin/xmldb/actions/new_table_from_mysql/new_table_from_mysql.class.php,v
retrieving revision 1.10
diff -u -r1.10 new_table_from_mysql.class.php
--- admin/xmldb/actions/new_table_from_mysql/new_table_from_mysql.class.php	20 May 2008 23:24:41 -0000	1.10
+++ admin/xmldb/actions/new_table_from_mysql/new_table_from_mysql.class.php	9 Jun 2008 13:36:14 -0000
@@ -65,7 +65,7 @@
     /// Do the job, setting result as needed
     /// Get the dir containing the file
         $dirpath = required_param('dir', PARAM_PATH);
-        $dirpath = $CFG->dirroot . stripslashes_safe($dirpath);
+        $dirpath = $CFG->dirroot . $dirpath;
 
     /// Get the correct dirs
         if (!empty($XMLDB->dbdirs)) {
Index: user/filters/lib.php
===================================================================
RCS file: /cvsroot/moodle/moodle/user/filters/lib.php,v
retrieving revision 1.7
diff -u -r1.7 lib.php
--- user/filters/lib.php	2 Jun 2008 21:56:07 -0000	1.7
+++ user/filters/lib.php	9 Jun 2008 13:38:06 -0000
@@ -48,7 +48,7 @@
 
         // fist the new filter form
         $this->_addform = new user_add_filter_form($baseurl, array('fields'=>$this->_fields, 'extraparams'=>$extraparams));
-        if ($adddata = $this->_addform->get_data(false)) {
+        if ($adddata = $this->_addform->get_data()) {
             foreach($this->_fields as $fname=>$field) {
                 $data = $field->check_data($adddata);
                 if ($data === false) {
@@ -66,7 +66,7 @@
 
         // now the active filters
         $this->_activeform = new user_active_filter_form($baseurl, array('fields'=>$this->_fields, 'extraparams'=>$extraparams));
-        if ($adddata = $this->_activeform->get_data(false)) {
+        if ($adddata = $this->_activeform->get_data()) {
             if (!empty($adddata->removeall)) {
                 $SESSION->user_filtering = array();
 
Index: admin/xmldb/actions/view_xml/view_xml.class.php
===================================================================
RCS file: /cvsroot/moodle/moodle/admin/xmldb/actions/view_xml/view_xml.class.php,v
retrieving revision 1.4
diff -u -r1.4 view_xml.class.php
--- admin/xmldb/actions/view_xml/view_xml.class.php	10 Oct 2007 05:25:23 -0000	1.4
+++ admin/xmldb/actions/view_xml/view_xml.class.php	9 Jun 2008 13:36:16 -0000
@@ -65,7 +65,7 @@
 
     /// Get the file parameter
         $file = required_param('file', PARAM_PATH);
-        $file = $CFG->dirroot . stripslashes_safe($file);
+        $file = $CFG->dirroot . $file;
     /// File must be under $CFG->wwwroot and
     ///  under one db directory (simple protection)
         if (substr($file, 0, strlen($CFG->dirroot)) == $CFG->dirroot &&
Index: course/import/groups/index.php
===================================================================
RCS file: /cvsroot/moodle/moodle/course/import/groups/index.php,v
retrieving revision 1.20
diff -u -r1.20 index.php
--- course/import/groups/index.php	1 Jun 2008 18:12:25 -0000	1.20
+++ course/import/groups/index.php	9 Jun 2008 13:36:35 -0000
@@ -128,11 +128,11 @@
                         //print_error('missingfield', 'error', 'uploaduser.php?sesskey='.$USER->sesskey, $name);
                     }
                     else if ($name == "groupname") {
-                        $newgroup->name = addslashes($value);
+                        $newgroup->name = $value;
                     }
                     // normal entry
                     else {
-                        $newgroup->{$name} = addslashes($value);
+                        $newgroup->{$name} = $value;
                     }
                 }
                 ///Find the courseid of the course with the given shortname
Index: admin/xmldb/actions/edit_index/edit_index.class.php
===================================================================
RCS file: /cvsroot/moodle/moodle/admin/xmldb/actions/edit_index/edit_index.class.php,v
retrieving revision 1.9
diff -u -r1.9 edit_index.class.php
--- admin/xmldb/actions/edit_index/edit_index.class.php	20 May 2008 23:24:40 -0000	1.9
+++ admin/xmldb/actions/edit_index/edit_index.class.php	9 Jun 2008 13:36:09 -0000
@@ -66,7 +66,7 @@
     /// Do the job, setting result as needed
     /// Get the dir containing the file
         $dirpath = required_param('dir', PARAM_PATH);
-        $dirpath = $CFG->dirroot . stripslashes_safe($dirpath);
+        $dirpath = $CFG->dirroot . $dirpath;
 
     /// Get the correct dirs
         if (!empty($XMLDB->dbdirs)) {
Index: admin/xmldb/actions/view_index_xml/view_index_xml.class.php
===================================================================
RCS file: /cvsroot/moodle/moodle/admin/xmldb/actions/view_index_xml/view_index_xml.class.php,v
retrieving revision 1.4
diff -u -r1.4 view_index_xml.class.php
--- admin/xmldb/actions/view_index_xml/view_index_xml.class.php	10 Oct 2007 05:25:26 -0000	1.4
+++ admin/xmldb/actions/view_index_xml/view_index_xml.class.php	9 Jun 2008 13:36:14 -0000
@@ -66,7 +66,7 @@
         $select = required_param('select', PARAM_ALPHA); //original/edited
     /// Get the dir containing the file
         $dirpath = required_param('dir', PARAM_PATH);
-        $dirpath = $CFG->dirroot . stripslashes_safe($dirpath);
+        $dirpath = $CFG->dirroot . $dirpath;
 
     /// Get the correct dir
         if ($select == 'original') {
Index: course/format/weeks/format.php
===================================================================
RCS file: /cvsroot/moodle/moodle/course/format/weeks/format.php,v
retrieving revision 1.83
diff -u -r1.83 format.php
--- course/format/weeks/format.php	1 Jun 2008 17:59:14 -0000	1.83
+++ course/format/weeks/format.php	9 Jun 2008 13:36:35 -0000
@@ -103,7 +103,7 @@
 
 /// If currently moving a file then show the current clipboard
     if (ismoving($course->id)) {
-        $stractivityclipboard = strip_tags(get_string('activityclipboard', '', addslashes($USER->activitycopyname)));
+        $stractivityclipboard = strip_tags(get_string('activityclipboard', '', $USER->activitycopyname));
         $strcancel= get_string('cancel');
         echo '<li class="clipboard">';
         echo $stractivityclipboard.'&nbsp;&nbsp;(<a href="mod.php?cancelcopy=true&amp;sesskey='.$USER->sesskey.'">'.$strcancel.'</a>)';
Index: admin/xmldb/actions/view_table_php/view_table_php.class.php
===================================================================
RCS file: /cvsroot/moodle/moodle/admin/xmldb/actions/view_table_php/view_table_php.class.php,v
retrieving revision 1.21
diff -u -r1.21 view_table_php.class.php
--- admin/xmldb/actions/view_table_php/view_table_php.class.php	23 May 2008 22:42:45 -0000	1.21
+++ admin/xmldb/actions/view_table_php/view_table_php.class.php	9 Jun 2008 13:36:16 -0000
@@ -71,7 +71,7 @@
     /// Do the job, setting result as needed
     /// Get the dir containing the file
         $dirpath = required_param('dir', PARAM_PATH);
-        $dirpath = $CFG->dirroot . stripslashes_safe($dirpath);
+        $dirpath = $CFG->dirroot . $dirpath;
 
     /// Get the correct dirs
         if (!empty($XMLDB->dbdirs)) {
Index: admin/xmldb/actions/delete_table/delete_table.class.php
===================================================================
RCS file: /cvsroot/moodle/moodle/admin/xmldb/actions/delete_table/delete_table.class.php,v
retrieving revision 1.5
diff -u -r1.5 delete_table.class.php
--- admin/xmldb/actions/delete_table/delete_table.class.php	10 Oct 2007 05:25:23 -0000	1.5
+++ admin/xmldb/actions/delete_table/delete_table.class.php	9 Jun 2008 13:36:08 -0000
@@ -64,7 +64,7 @@
 
     /// Get the dir containing the file
         $dirpath = required_param('dir', PARAM_PATH);
-        $dirpath = $CFG->dirroot . stripslashes_safe($dirpath);
+        $dirpath = $CFG->dirroot . $dirpath;
         $tableparam = required_param('table', PARAM_CLEAN);
 
         $confirmed = optional_param('confirmed', false, PARAM_BOOL);
Index: backup/restore_check.html
===================================================================
RCS file: /cvsroot/moodle/moodle/backup/restore_check.html,v
retrieving revision 1.57
diff -u -r1.57 restore_check.html
--- backup/restore_check.html	1 Jun 2008 14:46:48 -0000	1.57
+++ backup/restore_check.html	9 Jun 2008 13:36:19 -0000
@@ -21,8 +21,8 @@
 
     if ($form1 = data_submitted()) {
         $currentcourseshortname = $course_header->course_shortname; //"store_ShortName";
-        $course_header->course_shortname =  stripslashes_safe($form1->shortname);  //"update_ShortName";
-        $course_header->course_fullname =   stripslashes_safe($form1->fullname);   //"update_FullName";
+        $course_header->course_shortname =  $form1->shortname;  //"update_ShortName";
+        $course_header->course_fullname =   $form1->fullname;   //"update_FullName";
     /// Roll dates only if the backup course has a start date
     /// (some formats like main page, social..., haven't it and rolling dates
     /// from 0 produces crazy dates. MDL-10125
Index: backup/restorelib.php
===================================================================
RCS file: /cvsroot/moodle/moodle/backup/restorelib.php,v
retrieving revision 1.335
diff -u -r1.335 restorelib.php
--- backup/restorelib.php	5 Jun 2008 18:02:22 -0000	1.335
+++ backup/restorelib.php	9 Jun 2008 13:36:30 -0000
@@ -688,7 +688,7 @@
             $course->fullname = $course_header->course_fullname;
             $course->shortname = $course_header->course_shortname;
             $course->idnumber = $course_header->course_idnumber;
-            $course->idnumber = ''; //addslashes($course_header->course_idnumber); // we don't want this at all.
+            $course->idnumber = ''; //$course_header->course_idnumber; // we don't want this at all.
             $course->summary = backup_todb($course_header->course_summary);
             $course->format = $course_header->course_format;
             $course->showgrades = $course_header->course_showgrades;
@@ -701,7 +701,7 @@
             $course->startdate = $course_header->course_startdate;
             $course->startdate += $restore->course_startdateoffset;
             $course->numsections = $course_header->course_numsections;
-            //$course->showrecent = addslashes($course_header->course_showrecent);   INFO: This is out in 1.3
+            //$course->showrecent = $course_header->course_showrecent;   INFO: This is out in 1.3
             $course->maxbytes = $course_header->course_maxbytes;
             $course->showreports = $course_header->course_showreports;
             if (isset($course_header->course_groupmode)) {
@@ -2491,7 +2491,6 @@
                     //Unset the id because it's going to be inserted with a new one
                     unset ($user->id);
                     // relink the descriptions
-                    $user->description = stripslashes($user->description);
 
                 /// Disable pictures based on global setting or existing empty value (old backups can contain wrong empties)
                     if (!empty($CFG->disableuserimages) || empty($user->picture)) {
@@ -8205,7 +8204,7 @@
         fwrite ($restorelog_file,"<title>".$course_header->course_shortname." Restored </title>");
         fwrite ($restorelog_file,"</head><body><br/><h1>The following changes were made during the Restoration of this Course.</h1><br/><br/>");
         fwrite ($restorelog_file,"The Course ShortName is now - ".$course_header->course_shortname." The FullName is now - ".$course_header->course_fullname."<br/><br/>");
-        $startdate = addslashes($course_header->course_startdate);
+        $startdate = $course_header->course_startdate;
         $date = usergetdate($startdate);
         fwrite ($restorelog_file,"The Originating Courses Start Date was " .$date['weekday'].", ".$date['mday']." ".$date['month']." ".$date['year']."");
         $startdate += $restore->course_startdateoffset;
Index: backup/lib.php
===================================================================
RCS file: /cvsroot/moodle/moodle/backup/lib.php,v
retrieving revision 1.104
diff -u -r1.104 lib.php
--- backup/lib.php	5 Jun 2008 00:01:11 -0000	1.104
+++ backup/lib.php	9 Jun 2008 13:36:19 -0000
@@ -463,7 +463,7 @@
             //Set info_to save
             $info_to_save = "infile";
         } else {
-            //Saving to db, addslashes
+            //Saving to db
             $info_to_save = $info_ser;
         }
 
Index: admin/xmldb/actions/delete_index/delete_index.class.php
===================================================================
RCS file: /cvsroot/moodle/moodle/admin/xmldb/actions/delete_index/delete_index.class.php,v
retrieving revision 1.5
diff -u -r1.5 delete_index.class.php
--- admin/xmldb/actions/delete_index/delete_index.class.php	10 Oct 2007 05:25:20 -0000	1.5
+++ admin/xmldb/actions/delete_index/delete_index.class.php	9 Jun 2008 13:36:07 -0000
@@ -64,7 +64,7 @@
 
     /// Get the dir containing the file
         $dirpath = required_param('dir', PARAM_PATH);
-        $dirpath = $CFG->dirroot . stripslashes_safe($dirpath);
+        $dirpath = $CFG->dirroot . $dirpath;
         $tableparam = required_param('table', PARAM_PATH);
         $indexparam = required_param('index', PARAM_PATH);
 
Index: error/index.php
===================================================================
RCS file: /cvsroot/moodle/moodle/error/index.php,v
retrieving revision 1.19
diff -u -r1.19 index.php
--- error/index.php	7 May 2008 06:20:00 -0000	1.19
+++ error/index.php	9 Jun 2008 13:36:37 -0000
@@ -2,7 +2,7 @@
 
     require('../config.php');
 
-    if ($form = data_submitted('nomatch')) { // form submitted, do not check referer (original page unknown)!
+    if ($form = data_submitted()) { // form submitted, do not check referer (original page unknown)!
 
     /// Only deal with real users
         if (!isloggedin()) { 
Index: theme/chameleon/ui/ChameleonCSS.class.php
===================================================================
RCS file: /cvsroot/moodle/moodle/theme/chameleon/ui/ChameleonCSS.class.php,v
retrieving revision 1.3
diff -u -r1.3 ChameleonCSS.class.php
--- theme/chameleon/ui/ChameleonCSS.class.php	18 Jul 2006 09:11:35 -0000	1.3
+++ theme/chameleon/ui/ChameleonCSS.class.php	9 Jun 2008 13:38:05 -0000
@@ -23,7 +23,7 @@
             $this->error = 'couldn\'t open file';
             return false;
         }
-        fwrite($fp, stripslashes($content));
+        fwrite($fp, $content);
         fclose($fp);
         return true;
     }
Index: admin/xmldb/actions/new_statement/new_statement.class.php
===================================================================
RCS file: /cvsroot/moodle/moodle/admin/xmldb/actions/new_statement/new_statement.class.php,v
retrieving revision 1.7
diff -u -r1.7 new_statement.class.php
--- admin/xmldb/actions/new_statement/new_statement.class.php	20 May 2008 23:24:41 -0000	1.7
+++ admin/xmldb/actions/new_statement/new_statement.class.php	9 Jun 2008 13:36:13 -0000
@@ -65,7 +65,7 @@
     /// Do the job, setting result as needed
     /// Get the dir containing the file
         $dirpath = required_param('dir', PARAM_PATH);
-        $dirpath = $CFG->dirroot . stripslashes_safe($dirpath);
+        $dirpath = $CFG->dirroot . $dirpath;
 
     /// Get the correct dirs
         if (!empty($XMLDB->dbdirs)) {
Index: question/format/multianswer/format.php
===================================================================
RCS file: /cvsroot/moodle/moodle/question/format/multianswer/format.php,v
retrieving revision 1.4
diff -u -r1.4 format.php
--- question/format/multianswer/format.php	20 Mar 2007 02:25:16 -0000	1.4
+++ question/format/multianswer/format.php	9 Jun 2008 13:37:58 -0000
@@ -26,12 +26,12 @@
 
         $questions= array();
         $thequestion= qtype_multianswer_extract_question(
-                addslashes(implode('',$lines)));
+                implode('',$lines));
         $thequestion->qtype = MULTIANSWER;
         $thequestion->course = $this->course;
 
         if (!empty($thequestion)) {
-            $thequestion->name = addslashes($lines[0]);
+            $thequestion->name = $lines[0];
             
             $questions[] = $thequestion;
         }
Index: index.php
===================================================================
RCS file: /cvsroot/moodle/moodle/index.php,v
retrieving revision 1.213
diff -u -r1.213 index.php
--- index.php	2 Jun 2008 21:52:28 -0000	1.213
+++ index.php	9 Jun 2008 13:36:00 -0000
@@ -154,7 +154,7 @@
 
             /// If currently moving a file then show the current clipboard
             if (ismoving($SITE->id)) {
-                $stractivityclipboard = strip_tags(get_string('activityclipboard', '', addslashes($USER->activitycopyname)));
+                $stractivityclipboard = strip_tags(get_string('activityclipboard', '', $USER->activitycopyname));
                 echo '<p><font size="2">';
                 echo "$stractivityclipboard&nbsp;&nbsp;(<a href=\"course/mod.php?cancelcopy=true&amp;sesskey=$USER->sesskey\">". get_string('cancel') .'</a>)';
                 echo '</font></p>';
Index: admin/xmldb/actions/edit_sentence_save/edit_sentence_save.class.php
===================================================================
RCS file: /cvsroot/moodle/moodle/admin/xmldb/actions/edit_sentence_save/edit_sentence_save.class.php,v
retrieving revision 1.5
diff -u -r1.5 edit_sentence_save.class.php
--- admin/xmldb/actions/edit_sentence_save/edit_sentence_save.class.php	10 Oct 2007 05:25:25 -0000	1.5
+++ admin/xmldb/actions/edit_sentence_save/edit_sentence_save.class.php	9 Jun 2008 13:36:10 -0000
@@ -67,15 +67,15 @@
 
     /// Get parameters
         $dirpath = required_param('dir', PARAM_PATH);
-        $dirpath = $CFG->dirroot . stripslashes_safe($dirpath);
+        $dirpath = $CFG->dirroot . $dirpath;
 
         $statementparam = strtolower(required_param('statement', PARAM_CLEAN));
         $sentenceparam = strtolower(required_param('sentence', PARAM_ALPHANUM));
 
         $fields = required_param('fields', PARAM_CLEAN);
-        $fields = trim(stripslashes_safe($fields));
+        $fields = trim($fields);
         $values = required_param('values', PARAM_CLEAN);
-        $values = trim(stripslashes_safe($values));
+        $values = trim($values);
 
         $editeddir =& $XMLDB->editeddirs[$dirpath];
         $structure =& $editeddir->xml_file->getStructure();
Index: admin/xmldb/actions/edit_field_save/edit_field_save.class.php
===================================================================
RCS file: /cvsroot/moodle/moodle/admin/xmldb/actions/edit_field_save/edit_field_save.class.php,v
retrieving revision 1.8
diff -u -r1.8 edit_field_save.class.php
--- admin/xmldb/actions/edit_field_save/edit_field_save.class.php	20 May 2008 23:24:40 -0000	1.8
+++ admin/xmldb/actions/edit_field_save/edit_field_save.class.php	9 Jun 2008 13:36:09 -0000
@@ -75,20 +75,20 @@
 
     /// Do the job, setting result as needed
 
-        if (!data_submitted('nomatch')) { ///Basic prevention
+        if (!data_submitted()) { ///Basic prevention
             print_error('wrongcall', 'error');
         }
 
     /// Get parameters
         $dirpath = required_param('dir', PARAM_PATH);
-        $dirpath = $CFG->dirroot . stripslashes_safe($dirpath);
+        $dirpath = $CFG->dirroot . $dirpath;
 
         $tableparam = strtolower(required_param('table', PARAM_PATH));
         $fieldparam = strtolower(required_param('field', PARAM_PATH));
         $name = substr(trim(strtolower(optional_param('name', $fieldparam, PARAM_PATH))),0,30);
 
         $comment = required_param('comment', PARAM_CLEAN);
-        $comment = trim(stripslashes_safe($comment));
+        $comment = trim($comment);
 
         $type       = required_param('type', PARAM_INT);
         $length     = strtolower(optional_param('length', NULL, PARAM_ALPHANUM));
@@ -98,9 +98,9 @@
         $sequence   = optional_param('sequence', false, PARAM_BOOL);
         $enum       = optional_param('enum', false, PARAM_BOOL);
         $enumvalues = optional_param('enumvalues', 0, PARAM_CLEAN);
-        $enumvalues = trim(stripslashes_safe($enumvalues));
+        $enumvalues = trim($enumvalues);
         $default    = optional_param('default', NULL, PARAM_PATH);
-        $default    = trim(stripslashes_safe($default));
+        $default    = trim($default);
 
         $editeddir =& $XMLDB->editeddirs[$dirpath];
         $structure =& $editeddir->xml_file->getStructure();
Index: grade/export/txt/index.php
===================================================================
RCS file: /cvsroot/moodle/moodle/grade/export/txt/index.php,v
retrieving revision 1.34
diff -u -r1.34 index.php
--- grade/export/txt/index.php	3 Jun 2008 16:11:00 -0000	1.34
+++ grade/export/txt/index.php	9 Jun 2008 13:36:40 -0000
@@ -54,7 +54,7 @@
 $mform = new grade_export_form(null, array('includeseparator'=>true, 'publishing' => true));
 
 // process post information
-if ($data = $mform->get_data(false)) {
+if ($data = $mform->get_data()) {
     $export = new grade_export_txt($course, groups_get_course_group($course), '', false, false, $data->display, $data->decimals);
 
     // print the grades on screen for feedback
Index: admin/xmldb/actions/delete_field/delete_field.class.php
===================================================================
RCS file: /cvsroot/moodle/moodle/admin/xmldb/actions/delete_field/delete_field.class.php,v
retrieving revision 1.5
diff -u -r1.5 delete_field.class.php
--- admin/xmldb/actions/delete_field/delete_field.class.php	10 Oct 2007 05:25:25 -0000	1.5
+++ admin/xmldb/actions/delete_field/delete_field.class.php	9 Jun 2008 13:36:07 -0000
@@ -64,7 +64,7 @@
 
     /// Get the dir containing the file
         $dirpath = required_param('dir', PARAM_PATH);
-        $dirpath = $CFG->dirroot . stripslashes_safe($dirpath);
+        $dirpath = $CFG->dirroot . $dirpath;
         $tableparam = required_param('table', PARAM_CLEAN);
         $fieldparam = required_param('field', PARAM_CLEAN);
 
Index: admin/xmldb/actions/unload_xml_file/unload_xml_file.class.php
===================================================================
RCS file: /cvsroot/moodle/moodle/admin/xmldb/actions/unload_xml_file/unload_xml_file.class.php,v
retrieving revision 1.4
diff -u -r1.4 unload_xml_file.class.php
--- admin/xmldb/actions/unload_xml_file/unload_xml_file.class.php	10 Oct 2007 05:25:29 -0000	1.4
+++ admin/xmldb/actions/unload_xml_file/unload_xml_file.class.php	9 Jun 2008 13:36:14 -0000
@@ -63,7 +63,7 @@
 
     /// Get the dir containing the file
         $dirpath = required_param('dir', PARAM_PATH);
-        $dirpath = $CFG->dirroot . stripslashes_safe($dirpath);
+        $dirpath = $CFG->dirroot . $dirpath;
 
         /// Get the original dir and delete some elements
         if (!empty($XMLDB->dbdirs)) {
Index: grade/import/key.php
===================================================================
RCS file: /cvsroot/moodle/moodle/grade/import/key.php,v
retrieving revision 1.5
diff -u -r1.5 key.php
--- grade/import/key.php	3 Jun 2008 16:10:59 -0000	1.5
+++ grade/import/key.php	9 Jun 2008 13:36:41 -0000
@@ -89,7 +89,7 @@
 if ($editform->is_cancelled()) {
     redirect($returnurl);
 
-} elseif ($data = $editform->get_data(false)) {
+} elseif ($data = $editform->get_data()) {
 
     if ($data->id) {
         $record = new object();
Index: admin/xmldb/actions/edit_statement/edit_statement.class.php
===================================================================
RCS file: /cvsroot/moodle/moodle/admin/xmldb/actions/edit_statement/edit_statement.class.php,v
retrieving revision 1.8
diff -u -r1.8 edit_statement.class.php
--- admin/xmldb/actions/edit_statement/edit_statement.class.php	20 May 2008 23:24:40 -0000	1.8
+++ admin/xmldb/actions/edit_statement/edit_statement.class.php	9 Jun 2008 13:36:10 -0000
@@ -69,7 +69,7 @@
     /// Do the job, setting result as needed
     /// Get the dir containing the file
         $dirpath = required_param('dir', PARAM_PATH);
-        $dirpath = $CFG->dirroot . stripslashes_safe($dirpath);
+        $dirpath = $CFG->dirroot . $dirpath;
 
     /// Get the correct dirs
         if (!empty($XMLDB->dbdirs)) {
Index: admin/xmldb/actions/edit_field/edit_field.class.php
===================================================================
RCS file: /cvsroot/moodle/moodle/admin/xmldb/actions/edit_field/edit_field.class.php,v
retrieving revision 1.8
diff -u -r1.8 edit_field.class.php
--- admin/xmldb/actions/edit_field/edit_field.class.php	20 May 2008 23:24:40 -0000	1.8
+++ admin/xmldb/actions/edit_field/edit_field.class.php	9 Jun 2008 13:36:09 -0000
@@ -66,7 +66,7 @@
     /// Do the job, setting result as needed
     /// Get the dir containing the file
         $dirpath = required_param('dir', PARAM_PATH);
-        $dirpath = $CFG->dirroot . stripslashes_safe($dirpath);
+        $dirpath = $CFG->dirroot . $dirpath;
 
     /// Get the correct dirs
         if (!empty($XMLDB->dbdirs)) {
Index: admin/xmldb/actions/edit_key/edit_key.class.php
===================================================================
RCS file: /cvsroot/moodle/moodle/admin/xmldb/actions/edit_key/edit_key.class.php,v
retrieving revision 1.9
diff -u -r1.9 edit_key.class.php
--- admin/xmldb/actions/edit_key/edit_key.class.php	20 May 2008 23:24:40 -0000	1.9
+++ admin/xmldb/actions/edit_key/edit_key.class.php	9 Jun 2008 13:36:09 -0000
@@ -66,7 +66,7 @@
     /// Do the job, setting result as needed
     /// Get the dir containing the file
         $dirpath = required_param('dir', PARAM_PATH);
-        $dirpath = $CFG->dirroot . stripslashes_safe($dirpath);
+        $dirpath = $CFG->dirroot . $dirpath;
 
     /// Get the correct dirs
         if (!empty($XMLDB->dbdirs)) {
Index: mod/feedback/item/textarea/lib.php
===================================================================
RCS file: /cvsroot/moodle/moodle/mod/feedback/item/textarea/lib.php,v
retrieving revision 1.4
diff -u -r1.4 lib.php
--- mod/feedback/item/textarea/lib.php	7 Jun 2008 22:22:07 -0000	1.4
+++ mod/feedback/item/textarea/lib.php	9 Jun 2008 13:37:28 -0000
@@ -65,7 +65,7 @@
         if($values) {
             //echo '<table>';2
             // $itemnr++;
-            echo '<tr><th colspan="2" align="left">'. $itemnr . '&nbsp;' . stripslashes_safe($item->name) .'</th></tr>';
+            echo '<tr><th colspan="2" align="left">'. $itemnr . '&nbsp;' . $item->name .'</th></tr>';
             foreach($values as $value) {
                 echo '<tr><td valign="top" align="left">-&nbsp;&nbsp;</td><td align="left" valign="top">' . str_replace("\n", '<br />', $value->value) . '</td></tr>';
             }
@@ -78,7 +78,7 @@
         $analysed_item = $this->get_analysed($item, $groupid, $courseid);
 
         $worksheet->setFormat("<l><f><ro2><vo><c:green>");
-        $worksheet->write_string($rowOffset, 0, stripslashes_safe($item->name));
+        $worksheet->write_string($rowOffset, 0, $item->name);
         $data = $analysed_item->data;
         if(is_array($data)) {
             $worksheet->setFormat("<l><ro2><vo>");
@@ -105,7 +105,7 @@
         }
         $requiredmark =  ($item->required == 1)?'<span class="feedback_required_mark">*</span>':'';
     ?>
-        <td <?php echo $highlight;?> valign="top" align="<?php echo $align;?>"><?php echo format_text(stripslashes_safe($item->name) . $requiredmark, true, false, false);?></td>
+        <td <?php echo $highlight;?> valign="top" align="<?php echo $align;?>"><?php echo format_text($item->name . $requiredmark, true, false, false);?></td>
         <td valign="top" align="<?php echo $align;?>">
     <?php
         if($readonly){
@@ -134,7 +134,7 @@
     }
 
     function create_value($data) {
-        $data = addslashes(clean_text($data));
+        $data = clean_text($data);
         return $data;
     }
 
Index: admin/xmldb/actions/edit_key_save/edit_key_save.class.php
===================================================================
RCS file: /cvsroot/moodle/moodle/admin/xmldb/actions/edit_key_save/edit_key_save.class.php,v
retrieving revision 1.8
diff -u -r1.8 edit_key_save.class.php
--- admin/xmldb/actions/edit_key_save/edit_key_save.class.php	20 May 2008 23:24:40 -0000	1.8
+++ admin/xmldb/actions/edit_key_save/edit_key_save.class.php	9 Jun 2008 13:36:09 -0000
@@ -75,30 +75,30 @@
 
     /// Do the job, setting result as needed
 
-        if (!data_submitted('nomatch')) { ///Basic prevention
+        if (!data_submitted()) { ///Basic prevention
             print_error('wrongcall', 'error');
         }
 
     /// Get parameters
         $dirpath = required_param('dir', PARAM_PATH);
-        $dirpath = $CFG->dirroot . stripslashes_safe($dirpath);
+        $dirpath = $CFG->dirroot . $dirpath;
 
         $tableparam = strtolower(required_param('table', PARAM_PATH));
         $keyparam = strtolower(required_param('key', PARAM_PATH));
         $name = trim(strtolower(optional_param('name', $keyparam, PARAM_PATH)));
 
         $comment = required_param('comment', PARAM_CLEAN);
-        $comment = trim(stripslashes_safe($comment));
+        $comment = trim($comment);
 
         $type = required_param('type', PARAM_INT);
         $fields = required_param('fields', PARAM_CLEAN);
-        $fields = str_replace(' ', '', trim(strtolower(stripslashes_safe($fields))));
+        $fields = str_replace(' ', '', trim(strtolower($fields)));
 
         if ($type == XMLDB_KEY_FOREIGN ||
             $type == XMLDB_KEY_FOREIGN_UNIQUE) {
             $reftable = trim(strtolower(required_param('reftable', PARAM_PATH)));
             $reffields= required_param('reffields', PARAM_CLEAN);
-            $reffields = str_replace(' ', '', trim(strtolower(stripslashes_safe($reffields))));
+            $reffields = str_replace(' ', '', trim(strtolower($reffields)));
         }
 
         $editeddir =& $XMLDB->editeddirs[$dirpath];
Index: admin/xmldb/actions/edit_sentence/edit_sentence.class.php
===================================================================
RCS file: /cvsroot/moodle/moodle/admin/xmldb/actions/edit_sentence/edit_sentence.class.php,v
retrieving revision 1.7
diff -u -r1.7 edit_sentence.class.php
--- admin/xmldb/actions/edit_sentence/edit_sentence.class.php	10 Oct 2007 05:25:16 -0000	1.7
+++ admin/xmldb/actions/edit_sentence/edit_sentence.class.php	9 Jun 2008 13:36:09 -0000
@@ -64,7 +64,7 @@
     /// Do the job, setting result as needed
     /// Get the dir containing the file
         $dirpath = required_param('dir', PARAM_PATH);
-        $dirpath = $CFG->dirroot . stripslashes_safe($dirpath);
+        $dirpath = $CFG->dirroot . $dirpath;
 
     /// Get the correct dirs
         if (!empty($XMLDB->dbdirs)) {
Index: mod/feedback/item/textfield/lib.php
===================================================================
RCS file: /cvsroot/moodle/moodle/mod/feedback/item/textfield/lib.php,v
retrieving revision 1.4
diff -u -r1.4 lib.php
--- mod/feedback/item/textfield/lib.php	7 Jun 2008 22:22:07 -0000	1.4
+++ mod/feedback/item/textfield/lib.php	9 Jun 2008 13:37:28 -0000
@@ -64,7 +64,7 @@
         if($values) {
             //echo '<table>';2
             // $itemnr++;
-            echo '<tr><th colspan="2" align="left">'. $itemnr . '&nbsp;' . stripslashes_safe($item->name) .'</th></tr>';
+            echo '<tr><th colspan="2" align="left">'. $itemnr . '&nbsp;' . $item->name .'</th></tr>';
             foreach($values as $value) {
                 echo '<tr><td colspan="2" valign="top" align="left">-&nbsp;&nbsp;' . str_replace("\n", '<br />', $value->value) . '</td></tr>';
             }
@@ -77,7 +77,7 @@
         $analysed_item = $this->get_analysed($item, $groupid, $courseid);
 
         $worksheet->setFormat("<l><f><ro2><vo><c:green>");
-        $worksheet->write_string($rowOffset, 0, stripslashes_safe($item->name));
+        $worksheet->write_string($rowOffset, 0, $item->name);
         $data = $analysed_item->data;
         if(is_array($data)) {
             $worksheet->setFormat("<l><ro2><vo>");
@@ -104,7 +104,7 @@
         }
         $requiredmark =  ($item->required == 1)?'<span class="feedback_required_mark">*</span>':'';
     ?>
-        <td <?php echo $highlight;?> valign="top" align="<?php echo $align;?>"><?php echo format_text(stripslashes_safe($item->name) . $requiredmark, true, false, false);?></td>
+        <td <?php echo $highlight;?> valign="top" align="<?php echo $align;?>"><?php echo format_text($item->name . $requiredmark, true, false, false);?></td>
         <td valign="top" align="<?php echo $align;?>">
     <?php
         if($readonly){
@@ -134,7 +134,7 @@
     }
 
     function create_value($data) {
-        $data = addslashes(clean_text($data));
+        $data = clean_text($data);
         return $data;
     }
 
Index: admin/xmldb/actions/new_key/new_key.class.php
===================================================================
RCS file: /cvsroot/moodle/moodle/admin/xmldb/actions/new_key/new_key.class.php,v
retrieving revision 1.6
diff -u -r1.6 new_key.class.php
--- admin/xmldb/actions/new_key/new_key.class.php	20 May 2008 23:24:41 -0000	1.6
+++ admin/xmldb/actions/new_key/new_key.class.php	9 Jun 2008 13:36:13 -0000
@@ -62,7 +62,7 @@
     /// Do the job, setting result as needed
     /// Get the dir containing the file
         $dirpath = required_param('dir', PARAM_PATH);
-        $dirpath = $CFG->dirroot . stripslashes_safe($dirpath);
+        $dirpath = $CFG->dirroot . $dirpath;
 
     /// Get the correct dirs
         if (!empty($XMLDB->dbdirs)) {
Index: lib/editor/tinymce/coursefiles.php
===================================================================
RCS file: /cvsroot/moodle/moodle/lib/editor/tinymce/coursefiles.php,v
retrieving revision 1.3
diff -u -r1.3 coursefiles.php
--- lib/editor/tinymce/coursefiles.php	2 Jun 2008 21:05:51 -0000	1.3
+++ lib/editor/tinymce/coursefiles.php	9 Jun 2008 13:37:16 -0000
@@ -388,7 +388,7 @@
             html_header($course, $wdir);
             if (($text != '') and confirm_sesskey()) {
                 $fileptr = fopen($basedir.$file,"w");
-                fputs($fileptr, stripslashes($text));
+                fputs($fileptr, $text);
                 fclose($fileptr);
                 displaydir($wdir);
 
Index: question/format/xml/format.php
===================================================================
RCS file: /cvsroot/moodle/moodle/question/format/xml/format.php,v
retrieving revision 1.46
diff -u -r1.46 format.php
--- question/format/xml/format.php	27 May 2008 13:42:27 -0000	1.46
+++ question/format/xml/format.php	9 Jun 2008 13:38:00 -0000
@@ -79,7 +79,7 @@
             return '';
         }
         $data = $text[0]['#'];
-        return addslashes(trim( $data ));
+        return trim($data);
     }
 
     /**
@@ -108,7 +108,7 @@
             if (!is_string($xml)) {
                 $this->error( 'Invalid xml file - string expected (use CDATA?)' );
             }
-            $xml = addslashes( trim( $xml ) );
+            $xml = trim( $xml );
         }
 
         return $xml;
@@ -135,7 +135,7 @@
         $image = $this->getpath( $question, array('#','image',0,'#'), $qo->image );
         $image_base64 = $this->getpath( $question, array('#','image_base64','0','#'),'' );
         if (!empty($image_base64)) {
-            $qo->image = $this->importimagefile( $image, stripslashes($image_base64) );
+            $qo->image = $this->importimagefile( $image, $image_base64);
         }
         $qo->generalfeedback = $this->getpath( $question, array('#','generalfeedback',0,'#','text',0,'#'), $qo->generalfeedback, true );
         $qo->defaultgrade = $this->getpath( $question, array('#','defaultgrade',0,'#'), $qo->defaultgrade );
@@ -755,7 +755,7 @@
             return '';
         }
 
-        $content = "    <image_base64>\n".addslashes(base64_encode( $binary ))."\n".
+        $content = "    <image_base64>\n".base64_encode( $binary )."\n".
             "\n    </image_base64>\n";
         return $content;
     }
@@ -922,7 +922,7 @@
         case MULTIANSWER:
             $a_count=1;
             foreach($question->options->questions as $question) {
-                $thispattern = addslashes("{#".$a_count."}");
+                $thispattern = addslashes("{#".$a_count."}"); // TODO: fix this addslashes
                 $thisreplace = $question->questiontext;
                 $expout=ereg_replace($thispattern, $thisreplace, $expout );
                 $a_count++;
Index: mod/data/field/menu/field.class.php
===================================================================
RCS file: /cvsroot/moodle/moodle/mod/data/field/menu/field.class.php,v
retrieving revision 1.15
diff -u -r1.15 field.class.php
--- mod/data/field/menu/field.class.php	6 Jun 2008 08:39:45 -0000	1.15
+++ mod/data/field/menu/field.class.php	9 Jun 2008 13:37:24 -0000
@@ -88,7 +88,7 @@
             return '';
         }
 
-        return choose_from_menu($options, 'f_'.$this->field->id, stripslashes($content), '&nbsp;', '', 0, true);    
+        return choose_from_menu($options, 'f_'.$this->field->id, $content, '&nbsp;', '', 0, true);    
     }
 
      function parse_search_field() {
Index: question/format/blackboard/format.php
===================================================================
RCS file: /cvsroot/moodle/moodle/question/format/blackboard/format.php,v
retrieving revision 1.12
diff -u -r1.12 format.php
--- question/format/blackboard/format.php	24 Apr 2007 23:26:48 -0000	1.12
+++ question/format/blackboard/format.php	9 Jun 2008 13:37:55 -0000
@@ -104,7 +104,7 @@
         if ($ishtml) {
             $question->questiontext = html_entity_decode_php4(trim($thisquestion["#"]["BODY"][0]["#"]["TEXT"][0]["#"]));
         }
-        $question->questiontext = addslashes($question->questiontext);
+        $question->questiontext = $question->questiontext;
         // put name in question object
         $question->name = substr($question->questiontext, 0, 254);
 
@@ -117,12 +117,12 @@
 
         if (strcmp($id, $correct_answer) == 0) {  // true is correct
             $question->answer = 1;
-            $question->feedbacktrue = addslashes(trim(@$thisquestion["#"]["GRADABLE"][0]["#"]["FEEDBACK_WHEN_CORRECT"][0]["#"]));
-            $question->feedbackfalse = addslashes(trim(@$thisquestion["#"]["GRADABLE"][0]["#"]["FEEDBACK_WHEN_INCORRECT"][0]["#"]));
+            $question->feedbacktrue = trim(@$thisquestion["#"]["GRADABLE"][0]["#"]["FEEDBACK_WHEN_CORRECT"][0]["#"]);
+            $question->feedbackfalse = trim(@$thisquestion["#"]["GRADABLE"][0]["#"]["FEEDBACK_WHEN_INCORRECT"][0]["#"]);
         } else {  // false is correct
             $question->answer = 0;
-            $question->feedbacktrue = addslashes(trim(@$thisquestion["#"]["GRADABLE"][0]["#"]["FEEDBACK_WHEN_INCORRECT"][0]["#"]));
-            $question->feedbackfalse = addslashes(trim(@$thisquestion["#"]["GRADABLE"][0]["#"]["FEEDBACK_WHEN_CORRECT"][0]["#"]));
+            $question->feedbacktrue = trim(@$thisquestion["#"]["GRADABLE"][0]["#"]["FEEDBACK_WHEN_INCORRECT"][0]["#"]);
+            $question->feedbackfalse = trim(@$thisquestion["#"]["GRADABLE"][0]["#"]["FEEDBACK_WHEN_CORRECT"][0]["#"]);
         }
         $question->correctanswer = $question->answer;
         $questions[] = $question;
@@ -157,7 +157,7 @@
         if ($ishtml) {
             $question->questiontext = html_entity_decode_php4(trim($thisquestion["#"]["BODY"][0]["#"]["TEXT"][0]["#"]));
         }
-        $question->questiontext = addslashes($question->questiontext);
+        $question->questiontext = $question->questiontext;
 
         // put name of question in question object, careful of length
         $question->name = substr($question->questiontext, 0, 254);
@@ -170,7 +170,7 @@
             if ($ishtml) {
                 $question->answer[$j] = html_entity_decode_php4($choice);
             }
-            $question->answer[$j] = addslashes($question->answer[$j]);
+            $question->answer[$j] = $question->answer[$j];
 
             $id = $choices[$j]["@"]["id"];
             $correct_answer_id = $thisquestion["#"]["GRADABLE"][0]["#"]["CORRECTANSWER"][0]["@"]["answer_id"];
@@ -180,13 +180,13 @@
                 if ($ishtml) {
                     $question->feedback[$j] = html_entity_decode_php4(trim(@$thisquestion["#"]["GRADABLE"][0]["#"]["FEEDBACK_WHEN_CORRECT"][0]["#"]));
                 }
-                $question->feedback[$j] = addslashes($question->feedback[$j]);
+                $question->feedback[$j] = $question->feedback[$j];
             } else {
                 $question->fraction[$j] = 0;
                 if ($ishtml) {
                     $question->feedback[$j] = html_entity_decode_php4(trim(@$thisquestion["#"]["GRADABLE"][0]["#"]["FEEDBACK_WHEN_INCORRECT"][0]["#"]));
                 }
-                $question->feedback[$j] = addslashes($question->feedback[$j]);
+                $question->feedback[$j] = $question->feedback[$j];
             }
         }
         $questions[] = $question;
@@ -223,7 +223,7 @@
         if ($ishtml) {
             $question->questiontext = html_entity_decode_php4(trim($thisquestion["#"]["BODY"][0]["#"]["TEXT"][0]["#"]));
         }
-        $question->questiontext = addslashes($question->questiontext);
+        $question->questiontext = $question->questiontext;
         // put name of question in question object
         $question->name = substr($question->questiontext, 0, 254);
 
@@ -234,7 +234,7 @@
 
             $choice = trim($choices[$j]["#"]["TEXT"][0]["#"]);
             // put this choice in the question object.
-            $question->answer[$j] = addslashes($choice);
+            $question->answer[$j] = $choice;
 
             $correctanswercount = sizeof($correctanswers);
             $id = $choices[$j]["@"]["id"];
@@ -249,10 +249,10 @@
             }
             if ($iscorrect) { 
                 $question->fraction[$j] = floor(100000/$correctanswercount)/100000; // strange behavior if we have more than 5 decimal places
-                $question->feedback[$j] = addslashes(trim($thisquestion["#"]["GRADABLE"][$j]["#"]["FEEDBACK_WHEN_CORRECT"][0]["#"]));
+                $question->feedback[$j] = trim($thisquestion["#"]["GRADABLE"][$j]["#"]["FEEDBACK_WHEN_CORRECT"][0]["#"]);
             } else {
                 $question->fraction[$j] = 0;
-                $question->feedback[$j] = addslashes(trim($thisquestion["#"]["GRADABLE"][$j]["#"]["FEEDBACK_WHEN_INCORRECT"][0]["#"]));
+                $question->feedback[$j] = trim($thisquestion["#"]["GRADABLE"][$j]["#"]["FEEDBACK_WHEN_INCORRECT"][0]["#"]);
             }
         }
 
@@ -287,24 +287,24 @@
         if ($ishtml) {
             $question->questiontext = html_entity_decode_php4(trim($thisquestion["#"]["BODY"][0]["#"]["TEXT"][0]["#"]));
         }
-        $question->questiontext = addslashes($question->questiontext);
+        $question->questiontext = $question->questiontext;
         // put name of question in question object
         $question->name = substr($question->questiontext, 0, 254);
 
         $answer = trim($thisquestion["#"]["ANSWER"][0]["#"]["TEXT"][0]["#"]);
 
-        $question->answer[] = addslashes($answer);
+        $question->answer[] = $answer;
         $question->fraction[] = 1;
         $question->feedback = array();
 
         if (is_array( $thisquestion['#']['GRADABLE'][0]['#'] )) {
-            $question->feedback[0] = addslashes(trim($thisquestion["#"]["GRADABLE"][0]["#"]["FEEDBACK_WHEN_CORRECT"][0]["#"]));
+            $question->feedback[0] = trim($thisquestion["#"]["GRADABLE"][0]["#"]["FEEDBACK_WHEN_CORRECT"][0]["#"]);
         }
         else {
             $question->feedback[0] = '';
         }      
         if (is_array( $thisquestion["#"]["GRADABLE"][0]["#"] )) {
-            $question->feedback[1] = addslashes(trim($thisquestion["#"]["GRADABLE"][0]["#"]["FEEDBACK_WHEN_INCORRECT"][0]["#"]));
+            $question->feedback[1] = trim($thisquestion["#"]["GRADABLE"][0]["#"]["FEEDBACK_WHEN_INCORRECT"][0]["#"]);
         }
         else {
             $question->feedback[1] = '';
@@ -341,7 +341,7 @@
         if ($ishtml) {
             $question->questiontext = html_entity_decode_php4(trim($thisquestion["#"]["BODY"][0]["#"]["TEXT"][0]["#"]));
         }
-        $question->questiontext = addslashes($question->questiontext);
+        $question->questiontext = $question->questiontext;
         // put name of question in question object
         $question->name = substr($question->questiontext, 0, 254);
 
@@ -353,7 +353,7 @@
             $choice = $choices[$j]["#"]["TEXT"][0]["#"];
             $choice_id = $choices[$j]["@"]["id"];
           
-            $question->subanswers[] = addslashes(trim($choice));
+            $question->subanswers[] = trim($choice);
  
             $correctanswers = $thisquestion["#"]["GRADABLE"][0]["#"]["CORRECTANSWER"];
             for ($k = 0; $k < sizeof ($correctanswers); $k++) {
@@ -370,7 +370,7 @@
                         if (strcmp ($current_ans_id, $answer_id) == 0) {
 
                             $answer = $answer["#"]["TEXT"][0]["#"];
-                            $question->subquestions[] = addslashes(trim($answer));
+                            $question->subquestions[] = trim($answer);
                             break;
 
                         }
Index: admin/xmldb/actions/view_structure_php/view_structure_php.class.php
===================================================================
RCS file: /cvsroot/moodle/moodle/admin/xmldb/actions/view_structure_php/view_structure_php.class.php,v
retrieving revision 1.16
diff -u -r1.16 view_structure_php.class.php
--- admin/xmldb/actions/view_structure_php/view_structure_php.class.php	23 May 2008 22:34:53 -0000	1.16
+++ admin/xmldb/actions/view_structure_php/view_structure_php.class.php	9 Jun 2008 13:36:14 -0000
@@ -65,7 +65,7 @@
     /// Do the job, setting result as needed
     /// Get the dir containing the file
         $dirpath = required_param('dir', PARAM_PATH);
-        $dirpath = $CFG->dirroot . stripslashes_safe($dirpath);
+        $dirpath = $CFG->dirroot . $dirpath;
 
     /// Get the correct dirs
         if (!empty($XMLDB->dbdirs)) {
Index: question/type/match/questiontype.php
===================================================================
RCS file: /cvsroot/moodle/moodle/question/type/match/questiontype.php,v
retrieving revision 1.38
diff -u -r1.38 questiontype.php
--- question/type/match/questiontype.php	6 Jun 2008 14:43:17 -0000	1.38
+++ question/type/match/questiontype.php	9 Jun 2008 13:38:04 -0000
@@ -649,7 +649,7 @@
             foreach ($subquestions as $subquestion) {
                 $questiontext = restore_decode_content_links_worker($subquestion->questiontext, $restore);
                 if ($questiontext != $subquestion->questiontext) {
-                    $subquestion->questiontext = addslashes($questiontext);
+                    $subquestion->questiontext = $questiontext;
                     if (!$DB->update_record('question_match_sub', $subquestion)) {
                         $status = false;
                     }
Index: admin/xmldb/actions/revert_changes/revert_changes.class.php
===================================================================
RCS file: /cvsroot/moodle/moodle/admin/xmldb/actions/revert_changes/revert_changes.class.php,v
retrieving revision 1.5
diff -u -r1.5 revert_changes.class.php
--- admin/xmldb/actions/revert_changes/revert_changes.class.php	10 Oct 2007 05:25:24 -0000	1.5
+++ admin/xmldb/actions/revert_changes/revert_changes.class.php	9 Jun 2008 13:36:14 -0000
@@ -64,7 +64,7 @@
 
     /// Get the dir containing the file
         $dirpath = required_param('dir', PARAM_PATH);
-        $dirpath = $CFG->dirroot . stripslashes_safe($dirpath);
+        $dirpath = $CFG->dirroot . $dirpath;
 
         $confirmed = optional_param('confirmed', false, PARAM_BOOL);
 
Index: enrol/imsenterprise/enrol.php
===================================================================
RCS file: /cvsroot/moodle/moodle/enrol/imsenterprise/enrol.php,v
retrieving revision 1.18
diff -u -r1.18 enrol.php
--- enrol/imsenterprise/enrol.php	8 Jun 2008 15:31:27 -0000	1.18
+++ enrol/imsenterprise/enrol.php	9 Jun 2008 13:36:36 -0000
@@ -655,7 +655,7 @@
             $person->confirmed = 1;
             $person->timemodified = time();
             $person->mnethostid = $CFG->mnet_localhost_id;
-            if($id = $DB->insert_record('user', addslashes_object($person))){
+            if($id = $DB->insert_record('user', $person)){
     /*
     Photo processing is deactivated until we hear from Moodle dev forum about modification to gdlib.
 
Index: sso/hive/login.php
===================================================================
RCS file: /cvsroot/moodle/moodle/sso/hive/login.php,v
retrieving revision 1.4
diff -u -r1.4 login.php
--- sso/hive/login.php	9 Oct 2007 21:43:30 -0000	1.4
+++ sso/hive/login.php	9 Jun 2008 13:38:05 -0000
@@ -8,7 +8,7 @@
     require_login();
 
     // get the login data 
-    $frm = data_submitted('');
+    $frm = data_submitted();
 
     // log back into Hive
     if (sso_user_login($frm->username, $frm->password)) {  
Index: grade/export/xls/index.php
===================================================================
RCS file: /cvsroot/moodle/moodle/grade/export/xls/index.php,v
retrieving revision 1.29
diff -u -r1.29 index.php
--- grade/export/xls/index.php	3 Jun 2008 16:10:58 -0000	1.29
+++ grade/export/xls/index.php	9 Jun 2008 13:36:41 -0000
@@ -54,7 +54,7 @@
 $mform = new grade_export_form(null, array('publishing' => true));
 
 // process post information
-if ($data = $mform->get_data(false)) {
+if ($data = $mform->get_data()) {
     $export = new grade_export_xls($course, groups_get_course_group($course), '', false, false, $data->display, $data->decimals);
 
     // print the grades on screen for feedbacks
Index: question/format/examview/format.php
===================================================================
RCS file: /cvsroot/moodle/moodle/question/format/examview/format.php,v
retrieving revision 1.11
diff -u -r1.11 format.php
--- question/format/examview/format.php	6 Jun 2008 14:43:17 -0000	1.11
+++ question/format/examview/format.php	9 Jun 2008 13:37:56 -0000
@@ -40,7 +40,7 @@
     function unxmlise( $xml ) {
         // if it's not an array then it's probably just data
         if (!is_array($xml)) {
-            $text = s(addslashes($xml));
+            $text = s($xml);
         }
         else {
             // otherwise parse the array
@@ -101,17 +101,17 @@
         }
         foreach($this->matching_questions as $match_group) {
             $question = $this->defaultquestion();
-            $htmltext = s(addslashes($match_group->questiontext));
+            $htmltext = s($match_group->questiontext);
             $question->questiontext = $htmltext;
             $question->name = $question->questiontext;
             $question->qtype = MATCH;
             $question->subquestions = array();
             $question->subanswers = array();
             foreach($match_group->subquestions as $key => $value) {
-                $htmltext = s(addslashes($value));
+                $htmltext = s($value);
                 $question->subquestions[] = $htmltext;
 
-                $htmltext = s(addslashes($match_group->subanswers[$key]));
+                $htmltext = s($match_group->subanswers[$key]);
                 $question->subanswers[] = $htmltext;
             }
             $questions[] = $question;
@@ -245,7 +245,7 @@
         foreach($answers as $key => $value) {
             $value = trim($value);
             if (strlen($value) > 0) {
-                $question->answer[$key] = addslashes($value);
+                $question->answer[$key] = $value;
                 $question->fraction[$key] = 1;
                 $question->feedback[$key] = "Correct";
             }
Index: lib/grade/grade_object.php
===================================================================
RCS file: /cvsroot/moodle/moodle/lib/grade/grade_object.php,v
retrieving revision 1.44
diff -u -r1.44 grade_object.php
--- lib/grade/grade_object.php	5 Jun 2008 18:06:24 -0000	1.44
+++ lib/grade/grade_object.php	9 Jun 2008 13:37:16 -0000
@@ -256,7 +256,7 @@
      */
     public function get_record_data() {
         $data = new object();
-        // we need to do this to prevent infinite loops in addslashes_recursive - grade_item -> category ->grade_item
+
         foreach ($this as $var=>$value) {
             if (in_array($var, $this->required_fields) or array_key_exists($var, $this->optional_fields)) {
                 if (is_object($value) or is_array($value)) {
Index: grade/export/ods/index.php
===================================================================
RCS file: /cvsroot/moodle/moodle/grade/export/ods/index.php,v
retrieving revision 1.30
diff -u -r1.30 index.php
--- grade/export/ods/index.php	3 Jun 2008 16:11:02 -0000	1.30
+++ grade/export/ods/index.php	9 Jun 2008 13:36:40 -0000
@@ -54,7 +54,7 @@
 $mform = new grade_export_form(null, array('publishing' => true));
 
 // process post information
-if ($data = $mform->get_data(false)) {
+if ($data = $mform->get_data()) {
     $export = new grade_export_ods($course, groups_get_course_group($course), '', false, false, $data->display, $data->decimals);
 
     // print the grades on screen for feedbacks
Index: grade/edit/letter/edit.php
===================================================================
RCS file: /cvsroot/moodle/moodle/grade/edit/letter/edit.php,v
retrieving revision 1.8
diff -u -r1.8 edit.php
--- grade/edit/letter/edit.php	3 Jun 2008 16:10:59 -0000	1.8
+++ grade/edit/letter/edit.php	9 Jun 2008 13:36:39 -0000
@@ -80,7 +80,7 @@
 if ($mform->is_cancelled()) {
     redirect($returnurl);
 
-} else if ($data = $mform->get_data(false)) {
+} else if ($data = $mform->get_data()) {
     if (!$admin and empty($data->override)) {
         $DB->delete_records('grade_letters', array('contextid' => $context->id));
         redirect($returnurl);
Index: admin/xmldb/actions/delete_key/delete_key.class.php
===================================================================
RCS file: /cvsroot/moodle/moodle/admin/xmldb/actions/delete_key/delete_key.class.php,v
retrieving revision 1.5
diff -u -r1.5 delete_key.class.php
--- admin/xmldb/actions/delete_key/delete_key.class.php	10 Oct 2007 05:25:20 -0000	1.5
+++ admin/xmldb/actions/delete_key/delete_key.class.php	9 Jun 2008 13:36:08 -0000
@@ -64,7 +64,7 @@
 
     /// Get the dir containing the file
         $dirpath = required_param('dir', PARAM_PATH);
-        $dirpath = $CFG->dirroot . stripslashes_safe($dirpath);
+        $dirpath = $CFG->dirroot . $dirpath;
         $tableparam = required_param('table', PARAM_PATH);
         $keyparam = required_param('key', PARAM_PATH);
 
Index: mod/feedback/item/multichoice/lib.php
===================================================================
RCS file: /cvsroot/moodle/moodle/mod/feedback/item/multichoice/lib.php,v
retrieving revision 1.2
diff -u -r1.2 lib.php
--- mod/feedback/item/multichoice/lib.php	30 Apr 2008 22:17:05 -0000	1.2
+++ mod/feedback/item/multichoice/lib.php	9 Jun 2008 13:37:27 -0000
@@ -35,7 +35,7 @@
         
         $item_form->selecttype->setValue($info->subtype);
 
-        $itemvalues = str_replace(FEEDBACK_MULTICHOICE_LINE_SEP, "\n", stripslashes_safe($info->presentation));
+        $itemvalues = str_replace(FEEDBACK_MULTICHOICE_LINE_SEP, "\n", $info->presentation);
         $itemvalues = str_replace("\n\n", "\n", $itemvalues);
         $item_form->values->setValue($itemvalues);
         return $item_form;
@@ -54,7 +54,7 @@
         // $presentation = '';
         // @list($presentation) = explode(FEEDBACK_RADIO_ADJUST_SEP, $item->presentation); //remove the adjustment-info
         
-        $answers = explode (FEEDBACK_MULTICHOICE_LINE_SEP, stripslashes_safe($info->presentation));
+        $answers = explode (FEEDBACK_MULTICHOICE_LINE_SEP, $info->presentation);
         if(!is_array($answers)) return null;
 
         //die Werte holen
@@ -108,7 +108,7 @@
                 
         // @list($presentation) = explode(FEEDBACK_RADIO_ADJUST_SEP, $item->presentation); //remove the adjustment-info
         
-        $presentation = explode (FEEDBACK_MULTICHOICE_LINE_SEP, stripslashes_safe($info->presentation));
+        $presentation = explode (FEEDBACK_MULTICHOICE_LINE_SEP, $info->presentation);
         
         if($info->subtype == 'c') {
             $vallist = array_values(explode (FEEDBACK_MULTICHOICE_LINE_SEP, $value->value));
@@ -147,7 +147,7 @@
         $analysedItem = $this->get_analysed($item, $groupid, $courseid);
         if($analysedItem) {
             // $itemnr++;
-            $itemname = stripslashes($analysedItem[1]);
+            $itemname = $analysedItem[1];
             echo '<tr><th colspan="2" align="left">'. $itemnr . '&nbsp;' . $itemname .'</th></tr>';
             $analysedVals = $analysedItem[2];
             $pixnr = 0;
@@ -175,7 +175,7 @@
 
         $worksheet->setFormat("<l><f><ro2><vo><c:green>");
         //frage schreiben
-        $worksheet->write_string($rowOffset, 0, stripslashes($analysed_item[1]));
+        $worksheet->write_string($rowOffset, 0, $analysed_item[1]);
         if(is_array($data)) {
             for($i = 0; $i < sizeof($data); $i++) {
                 $aData = $data[$i];
@@ -197,7 +197,7 @@
         $info = $this->get_info($item);
         $align = get_string('thisdirection') == 'ltr' ? 'left' : 'right';
         
-        $presentation = explode (FEEDBACK_MULTICHOICE_LINE_SEP, stripslashes_safe($info->presentation));
+        $presentation = explode (FEEDBACK_MULTICHOICE_LINE_SEP, $info->presentation);
         
         
         //test if required and no value is set so we have to mark this item
@@ -215,7 +215,7 @@
             }
             $requiredmark =  ($item->required == 1)?'<span class="feedback_required_mark">*</span>':'';
             
-            echo '<td '.$highlight.' valign="top" align="'.$align.'">'.format_text(stripslashes_safe($item->name).$requiredmark, true, false, false).'</td>';
+            echo '<td '.$highlight.' valign="top" align="'.$align.'">'.format_text($item->name.$requiredmark, true, false, false).'</td>';
             echo '<td valign="top" align="'.$align.'">';
         }else {
             if($highlightrequire AND $item->required AND intval($value) <= 0) {
@@ -225,7 +225,7 @@
             }
             $requiredmark =  ($item->required == 1)?'<span class="feedback_required_mark">*</span>':'';
             ?>
-                <td <?php echo $highlight;?> valign="top" align="<?php echo $align;?>"><?php echo format_text(stripslashes_safe($item->name) . $requiredmark, true, false, false);?></td>
+                <td <?php echo $highlight;?> valign="top" align="<?php echo $align;?>"><?php echo format_text($item->name . $requiredmark, true, false, false);?></td>
                 <td valign="top" align="<?php echo $align;?>">
             <?php
         }
Index: mod/feedback/item/numeric/lib.php
===================================================================
RCS file: /cvsroot/moodle/moodle/mod/feedback/item/numeric/lib.php,v
retrieving revision 1.4
diff -u -r1.4 lib.php
--- mod/feedback/item/numeric/lib.php	7 Jun 2008 22:22:07 -0000	1.4
+++ mod/feedback/item/numeric/lib.php	9 Jun 2008 13:37:28 -0000
@@ -87,7 +87,7 @@
         if(isset($values->data) AND is_array($values->data)) {
             //echo '<table>';2
             // $itemnr++;
-            echo '<tr><th colspan="2" align="left">'. $itemnr . '&nbsp;' . stripslashes($item->name) .'</th></tr>';
+            echo '<tr><th colspan="2" align="left">'. $itemnr . '&nbsp;' . $item->name .'</th></tr>';
             foreach($values->data as $value) {
                 echo '<tr><td colspan="2" valign="top" align="left">-&nbsp;&nbsp;' . $value . '</td></tr>';
             }
@@ -106,7 +106,7 @@
         $analysed_item = $this->get_analysed($item, $groupid, $courseid);
 
         $worksheet->setFormat("<l><f><ro2><vo><c:green>");
-        $worksheet->write_string($rowOffset, 0, stripslashes($item->name));
+        $worksheet->write_string($rowOffset, 0, $item->name);
         $data = $analysed_item->data;
         if(is_array($data)) {
             // $worksheet->setFormat("<l><ro2><vo>");
@@ -148,7 +148,7 @@
     ?>
         <td <?php echo $highlight;?> valign="top" align="<?php echo $align;?>">
             <?php 
-                echo format_text(stripslashes_safe($item->name) . $requiredmark, true, false, false);
+                echo format_text($item->name . $requiredmark, true, false, false);
                 switch(true) {
                     case ($range_from === 0 AND $range_to > 0):
                         echo ' ('.get_string('maximal', 'feedback').': '.$range_to.')';
Index: question/format/webct/format.php
===================================================================
RCS file: /cvsroot/moodle/moodle/question/format/webct/format.php,v
retrieving revision 1.18
diff -u -r1.18 format.php
--- question/format/webct/format.php	21 May 2008 07:53:24 -0000	1.18
+++ question/format/webct/format.php	9 Jun 2008 13:38:00 -0000
@@ -191,7 +191,7 @@
 
             if (isset($questiontext) and is_string($questiontext)) {
                 if (ereg("^:",$line)) {
-                    $question->questiontext = addslashes(trim($questiontext));
+                    $question->questiontext = trim($questiontext);
                     unset($questiontext);
                 }
                  else {
@@ -202,7 +202,7 @@
 
             if (isset($answertext) and is_string($answertext)) {
                 if (ereg("^:",$line)) {
-                    $answertext = addslashes(trim($answertext));
+                    $answertext = trim($answertext);
                     $question->answer[$currentchoice] = $answertext;
                     $question->subanswers[$currentchoice] = $answertext;
                     unset($answertext);
@@ -215,7 +215,7 @@
 
             if (isset($responsetext) and is_string($responsetext)) {
                 if (ereg("^:",$line)) {
-                    $question->subquestions[$currentchoice] = addslashes(trim($responsetext));
+                    $question->subquestions[$currentchoice] = trim($responsetext);
                     unset($responsetext);
                 }
                  else {
@@ -226,7 +226,7 @@
 
             if (isset($feedbacktext) and is_string($feedbacktext)) {
                 if (ereg("^:",$line)) {
-                   $question->feedback[$currentchoice] = addslashes(trim($feedbacktext));
+                   $question->feedback[$currentchoice] = trim($feedbacktext);
                     unset($feedbacktext);
                 }
                  else {
@@ -237,7 +237,7 @@
 
             if (isset($generalfeedbacktext) and is_string($generalfeedbacktext)) {
                 if (ereg("^:",$line)) {
-                   $question->tempgeneralfeedback= addslashes(trim($generalfeedbacktext));
+                   $question->tempgeneralfeedback= trim($generalfeedbacktext);
                     unset($generalfeedbacktext);
                 }
                  else {
@@ -469,7 +469,7 @@
                     $name = substr($name,0,250)."...";
                     $warnings[] = get_string("questionnametoolong", "quiz", $nLineCounter);
                 }
-                $question->name = addslashes($name);
+                $question->name = $name;
                 continue;
             }
 
Index: admin/xmldb/actions/delete_sentence/delete_sentence.class.php
===================================================================
RCS file: /cvsroot/moodle/moodle/admin/xmldb/actions/delete_sentence/delete_sentence.class.php,v
retrieving revision 1.5
diff -u -r1.5 delete_sentence.class.php
--- admin/xmldb/actions/delete_sentence/delete_sentence.class.php	10 Oct 2007 05:25:22 -0000	1.5
+++ admin/xmldb/actions/delete_sentence/delete_sentence.class.php	9 Jun 2008 13:36:08 -0000
@@ -64,7 +64,7 @@
 
     /// Get the dir containing the file
         $dirpath = required_param('dir', PARAM_PATH);
-        $dirpath = $CFG->dirroot . stripslashes_safe($dirpath);
+        $dirpath = $CFG->dirroot . $dirpath;
         $statementparam = required_param('statement', PARAM_CLEAN);
         $sentenceparam = required_param('sentence', PARAM_INT);
 
Index: mod/assignment/type/upload/assignment.class.php
===================================================================
RCS file: /cvsroot/moodle/moodle/mod/assignment/type/upload/assignment.class.php,v
retrieving revision 1.49
diff -u -r1.49 assignment.class.php
--- mod/assignment/type/upload/assignment.class.php	5 Jun 2008 13:12:00 -0000	1.49
+++ mod/assignment/type/upload/assignment.class.php	9 Jun 2008 13:37:21 -0000
@@ -502,7 +502,7 @@
             die;
         }
 
-        if ($data = $mform->get_data(false) and $action == 'savenotes') {
+        if ($data = $mform->get_data() and $action == 'savenotes') {
             $submission = $this->get_submission($USER->id, true); // get or create submission
             $updated = new object();
             $updated->id           = $submission->id;
@@ -544,7 +544,7 @@
 
         $returnurl = "submissions.php?id={$this->cm->id}&amp;userid=$userid&amp;mode=$mode&amp;offset=$offset";
 
-        if (data_submitted('nomatch') and $this->can_manage_responsefiles()) {
+        if (data_submitted() and $this->can_manage_responsefiles()) {
             $dir = $this->file_area_name($userid).'/responses';
             check_dir_exists($CFG->dataroot.'/'.$dir, true, true);
 
Index: course/format/topics/format.php
===================================================================
RCS file: /cvsroot/moodle/moodle/course/format/topics/format.php,v
retrieving revision 1.90
diff -u -r1.90 format.php
--- course/format/topics/format.php	1 Jun 2008 17:59:13 -0000	1.90
+++ course/format/topics/format.php	9 Jun 2008 13:36:35 -0000
@@ -113,7 +113,7 @@
 
 /// If currently moving a file then show the current clipboard
     if (ismoving($course->id)) {
-        $stractivityclipboard = strip_tags(get_string('activityclipboard', '', addslashes($USER->activitycopyname)));
+        $stractivityclipboard = strip_tags(get_string('activityclipboard', '', $USER->activitycopyname));
         $strcancel= get_string('cancel');
         echo '<li class="clipboard">';
         echo $stractivityclipboard.'&nbsp;&nbsp;(<a href="mod.php?cancelcopy=true&amp;sesskey='.$USER->sesskey.'">'.$strcancel.'</a>)';
