MDL-15189 magic quotes finally removed
authorskodak <skodak>
Mon, 9 Jun 2008 16:53:30 +0000 (16:53 +0000)
committerskodak <skodak>
Mon, 9 Jun 2008 16:53:30 +0000 (16:53 +0000)
249 files changed:
admin/auth_config.php
admin/cliupgrade.php
admin/enrol_config.php
admin/filter.php
admin/lang.php
admin/maintenance.php
admin/mnet/MethodTable.php
admin/mnet/access_control.php
admin/mnet/adminlib.php
admin/mnet/enr_course_enrol.php
admin/mnet/index.php
admin/mnet/mnet_themes.php
admin/replace.php
admin/roles/allowoverride.php
admin/roles/manage.php
admin/roles/override.php
admin/search.php
admin/settings.php
admin/upgradesettings.php
admin/uploadpicture.php
admin/uploaduser.php
admin/user/user_bulk.php
admin/user/user_bulk_confirm.php
admin/user/user_bulk_message.php
admin/xmldb/actions/XMLDBAction.class.php
admin/xmldb/actions/create_xml_file/create_xml_file.class.php
admin/xmldb/actions/delete_field/delete_field.class.php
admin/xmldb/actions/delete_index/delete_index.class.php
admin/xmldb/actions/delete_key/delete_key.class.php
admin/xmldb/actions/delete_sentence/delete_sentence.class.php
admin/xmldb/actions/delete_statement/delete_statement.class.php
admin/xmldb/actions/delete_table/delete_table.class.php
admin/xmldb/actions/delete_xml_file/delete_xml_file.class.php
admin/xmldb/actions/edit_field/edit_field.class.php
admin/xmldb/actions/edit_field_save/edit_field_save.class.php
admin/xmldb/actions/edit_index/edit_index.class.php
admin/xmldb/actions/edit_index_save/edit_index_save.class.php
admin/xmldb/actions/edit_key/edit_key.class.php
admin/xmldb/actions/edit_key_save/edit_key_save.class.php
admin/xmldb/actions/edit_sentence/edit_sentence.class.php
admin/xmldb/actions/edit_sentence_save/edit_sentence_save.class.php
admin/xmldb/actions/edit_statement/edit_statement.class.php
admin/xmldb/actions/edit_statement_save/edit_statement_save.class.php
admin/xmldb/actions/edit_table/edit_table.class.php
admin/xmldb/actions/edit_table_save/edit_table_save.class.php
admin/xmldb/actions/edit_xml_file/edit_xml_file.class.php
admin/xmldb/actions/edit_xml_file_save/edit_xml_file_save.class.php
admin/xmldb/actions/load_xml_file/load_xml_file.class.php
admin/xmldb/actions/move_updown_field/move_updown_field.class.php
admin/xmldb/actions/move_updown_index/move_updown_index.class.php
admin/xmldb/actions/move_updown_key/move_updown_key.class.php
admin/xmldb/actions/move_updown_statement/move_updown_statement.class.php
admin/xmldb/actions/move_updown_table/move_updown_table.class.php
admin/xmldb/actions/new_field/new_field.class.php
admin/xmldb/actions/new_index/new_index.class.php
admin/xmldb/actions/new_key/new_key.class.php
admin/xmldb/actions/new_sentence/new_sentence.class.php
admin/xmldb/actions/new_statement/new_statement.class.php
admin/xmldb/actions/new_table/new_table.class.php
admin/xmldb/actions/new_table_from_mysql/new_table_from_mysql.class.php
admin/xmldb/actions/revert_changes/revert_changes.class.php
admin/xmldb/actions/save_xml_file/save_xml_file.class.php
admin/xmldb/actions/template/template.class.php
admin/xmldb/actions/unload_xml_file/unload_xml_file.class.php
admin/xmldb/actions/view_field_xml/view_field_xml.class.php
admin/xmldb/actions/view_index_xml/view_index_xml.class.php
admin/xmldb/actions/view_key_xml/view_key_xml.class.php
admin/xmldb/actions/view_statement_xml/view_statement_xml.class.php
admin/xmldb/actions/view_structure_php/view_structure_php.class.php
admin/xmldb/actions/view_structure_sql/view_structure_sql.class.php
admin/xmldb/actions/view_structure_xml/view_structure_xml.class.php
admin/xmldb/actions/view_table_php/view_table_php.class.php
admin/xmldb/actions/view_table_sql/view_table_sql.class.php
admin/xmldb/actions/view_table_xml/view_table_xml.class.php
admin/xmldb/actions/view_xml/view_xml.class.php
auth/db/auth.php
auth/mnet/auth.php
backup/lib.php
backup/restore_check.html
backup/restorelib.php
blocks/search/config_global.html
blog/edit.php
calendar/event.php
calendar/preferences.php
course/category.php
course/edit.php
course/editcategory.php
course/editsection.php
course/format/topics/format.php
course/format/weeks/format.php
course/import/activities/index.php
course/import/groups/index.php
course/importstudents.php
course/index.php
course/info.php
course/modedit.php
course/pending.php
course/recent.php
course/request.php
course/reset.php
course/search.php
enrol/imsenterprise/enrol.php
enrol/manual/enrol.php
enrol/paypal/ipn.php
error/index.php
files/index.php
filter/tex/texdebug.php
grade/edit/letter/edit.php
grade/edit/outcome/course.php
grade/edit/outcome/edit.php
grade/edit/outcome/index.php
grade/edit/scale/edit.php
grade/edit/settings/index.php
grade/edit/tree/calculation.php
grade/edit/tree/category.php
grade/edit/tree/grade.php
grade/edit/tree/item.php
grade/edit/tree/outcomeitem.php
grade/export/key.php
grade/export/ods/index.php
grade/export/txt/index.php
grade/export/xls/index.php
grade/export/xml/index.php
grade/import/csv/index.php
grade/import/key.php
grade/import/xml/index.php
grade/report/grader/ajax_callbacks.php
grade/report/grader/index.php
grade/report/grader/lib.php
grade/report/grader/preferences.php
group/assign.php
group/autogroup.php
group/members.php
index.php
lib/adminlib.php
lib/blocklib.php
lib/datalib.php
lib/deprecatedlib.php
lib/dml/mssql_adodb_moodle_database.php
lib/dml/oci8po_adodb_moodle_database.php
lib/dmllib.php
lib/editor/htmlarea/coursefiles.php
lib/editor/htmlarea/htmlarea.php
lib/editor/htmlarea/popups/preview.php
lib/editor/tinymce/coursefiles.php
lib/editor/tinymce/jscripts/tiny_mce/plugins/moodleimage/preview.php
lib/editor/tinymce/jscripts/tiny_mce/plugins/spellchecker/classes/SpellChecker.php
lib/formslib.php
lib/grade/grade_object.php
lib/moodlelib.php
lib/questionlib.php
lib/recaptchalib.php
lib/searchlib.php
lib/setup.php
lib/weblib.php
login/change_password.php
login/forgot_password.php
login/index.php
login/signup.php
message/lib.php
message/send.php
mod/assignment/lib.php
mod/assignment/type/upload/assignment.class.php
mod/chat/gui_header_js/insert.php
mod/choice/lib.php
mod/data/comment.php
mod/data/edit.php
mod/data/field.php
mod/data/field/menu/field.class.php
mod/data/templates.php
mod/feedback/analysis_to_excel.php
mod/feedback/complete.php
mod/feedback/complete_guest.php
mod/feedback/delete_template.php
mod/feedback/edit.php
mod/feedback/edit_item.php
mod/feedback/import.php
mod/feedback/item/captcha/lib.php
mod/feedback/item/label/lib.php
mod/feedback/item/multichoice/lib.php
mod/feedback/item/multichoicerated/lib.php
mod/feedback/item/numeric/lib.php
mod/feedback/item/textarea/lib.php
mod/feedback/item/textfield/lib.php
mod/feedback/mapcourse.php
mod/feedback/print.php
mod/feedback/show_entries.php
mod/feedback/show_entries_anonym.php
mod/forum/lib.php
mod/forum/restorelib.php
mod/forum/search.php
mod/forum/subscribers.php
mod/glossary/comment.php
mod/glossary/edit.php
mod/glossary/import.php
mod/glossary/rate.php
mod/hotpot/attempt.php
mod/hotpot/lib.php
mod/hotpot/report/overview/report.php
mod/hotpot/restorelib.php
mod/lesson/action/continue.php
mod/lesson/action/insertpage.php
mod/lesson/action/updatepage.php
mod/lesson/essay.php
mod/lesson/format.php
mod/lesson/highscores.php
mod/lesson/report.php
mod/lesson/view.php
mod/scorm/datamodels/scorm_12.js.php
mod/scorm/datamodels/scorm_13.js.php
mod/scorm/datamodels/scorm_13lib.php
mod/scorm/datamodels/scormlib.php
mod/survey/report.php
mod/survey/save.php
mod/wiki/ewikimoodlelib.php
mod/wiki/view.php
notes/add.php
notes/delete.php
notes/edit.php
question/category_class.php
question/comment.html
question/format.php
question/format/aiken/format.php
question/format/blackboard/format.php
question/format/blackboard_6/format.php
question/format/coursetestmanager/format.php
question/format/examview/format.php
question/format/gift/format.php
question/format/hotpot/format.php
question/format/missingword/format.php
question/format/multianswer/format.php
question/format/qti2/format.php
question/format/webct/format.php
question/format/xml/format.php
question/type/essay/questiontype.php
question/type/match/questiontype.php
question/type/multichoice/questiontype.php
question/type/numerical/questiontype.php
question/type/questiontype.php
question/type/shortanswer/questiontype.php
sso/hive/login.php
tag/edit.php
tag/tag_autocomplete.php
theme/chameleon/ui/ChameleonCSS.class.php
user/edit.php
user/editadvanced.php
user/filters/lib.php
user/messageselect.php
user/profile/definelib.php

index 9e150a8..4e0b288 100644 (file)
@@ -18,7 +18,7 @@ $err = array();
 $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 f54ed4a..a46ab62 100644 (file)
@@ -738,14 +738,6 @@ if ( file_exists(dirname(dirname(__FILE__)) . '/config.php')) {
         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 @@ if ( file_exists(dirname(dirname(__FILE__)) . '/config.php')) {
         }
 
         $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 f9fe5ce..0ed836f 100644 (file)
@@ -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 d9bb979..3a3a697 100644 (file)
@@ -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 72c6105..b9c98e0 100644 (file)
@@ -1358,7 +1358,7 @@ function lang_help_save_file($helproot, $file, $content) {
     }
     error_reporting($CFG->debug);
 
-    fwrite($f, stripslashes($content));
+    fwrite($f, $content);
     fclose($f);
 
     // Remove file if its empty
index a4bfa1c..dc6729e 100644 (file)
@@ -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 e5e4b39..e9c4e6e 100644 (file)
@@ -556,7 +556,7 @@ class MethodTable
                 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 f4ebaf8..0bd1c9b 100644 (file)
@@ -80,7 +80,7 @@ if (!empty($action) and confirm_sesskey()) {
 
 
 // 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 c2308fa..8c54554 100644 (file)
@@ -87,7 +87,7 @@ function mnet_get_functions($type, $parentname) {
                 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 bc43e93..52dbae7 100644 (file)
@@ -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 321ee35..a281f1c 100644 (file)
@@ -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 180d8c3..f566744 100644 (file)
@@ -65,7 +65,7 @@ ini_set('display_errors', true);
                 $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 f9dc986..4e8df42 100644 (file)
@@ -10,9 +10,6 @@ admin_externalpage_setup('replace');
 $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 cb05671..eacc00d 100755 (executable)
@@ -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 e522362..254db54 100755 (executable)
@@ -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);
             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 72359f7..bdd55f6 100755 (executable)
@@ -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 a8ee38b..f3b5557 100644 (file)
@@ -7,8 +7,6 @@ require_once($CFG->libdir.'/adminlib.php');
 
 $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 @@ $focus = '';
 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 d0f771f..1ee4358 100644 (file)
@@ -31,7 +31,7 @@ $statusmsg = '';
 $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 6d4d5e1..65fbf3c 100644 (file)
@@ -15,7 +15,7 @@ $adminroot =& admin_get_root(); // need all settings
 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 e9e82d9..e8122bf 100644 (file)
@@ -62,7 +62,7 @@ admin_externalpage_print_header();
 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 ba81acf..1a83c4a 100755 (executable)
@@ -125,7 +125,7 @@ if ($formdata = $mform->is_cancelled()) {
     $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 ae13d7c..acd9a4f 100755 (executable)
@@ -16,7 +16,7 @@ $ufiltering = new user_filtering();
 // 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 @@ if ($data = $action_form->get_data(false)) {
 
 $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 163623e..df433f7 100755 (executable)
@@ -29,7 +29,7 @@ if ($confirm and confirm_sesskey()) {
                 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 bac02b6..4c7f2d5 100755 (executable)
@@ -43,7 +43,7 @@ $msgform = new user_message_form('user_bulk_message.php');
 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 c1eaa93..201e676 100644 (file)
@@ -140,7 +140,7 @@ class XMLDBAction {
     /// 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 f4fa487..03f36b8 100644 (file)
@@ -66,7 +66,7 @@ class create_xml_file extends XMLDBAction {
 
     /// 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 1cda159..57ad55e 100644 (file)
@@ -64,7 +64,7 @@ class delete_field extends XMLDBAction {
 
     /// 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 8d125c6..d9ff4e3 100644 (file)
@@ -64,7 +64,7 @@ class delete_index extends XMLDBAction {
 
     /// 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 b5c5f53..f6bfa87 100644 (file)
@@ -64,7 +64,7 @@ class delete_key extends XMLDBAction {
 
     /// 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 41d7a65..6b6a8bb 100644 (file)
@@ -64,7 +64,7 @@ class delete_sentence extends XMLDBAction {
 
     /// 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 434b13e..95f6149 100644 (file)
@@ -64,7 +64,7 @@ class delete_statement extends XMLDBAction {
 
     /// 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 629eda4..b03d01f 100644 (file)
@@ -64,7 +64,7 @@ class delete_table extends XMLDBAction {
 
     /// 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 0a21ad7..7a4d56f 100644 (file)
@@ -64,7 +64,7 @@ class delete_xml_file extends XMLDBAction {
 
     /// 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 04d7946..78f8812 100644 (file)
@@ -66,7 +66,7 @@ class edit_field extends XMLDBAction {
     /// 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 512b6c7..7a842fa 100644 (file)
@@ -75,20 +75,20 @@ class edit_field_save extends XMLDBAction {
 
     /// 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 @@ class edit_field_save extends XMLDBAction {
         $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 7422b23..9ba4588 100644 (file)
@@ -66,7 +66,7 @@ class edit_index extends XMLDBAction {
     /// 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 4d8f139..6a047f9 100644 (file)
@@ -69,24 +69,24 @@ class edit_index_save extends XMLDBAction {
 
     /// 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 7858711..085fd71 100644 (file)
@@ -66,7 +66,7 @@ class edit_key extends XMLDBAction {
     /// 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 3f3ef0a..3e97985 100644 (file)
@@ -75,30 +75,30 @@ class edit_key_save extends XMLDBAction {
 
     /// 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 d72d169..c8240ea 100644 (file)
@@ -64,7 +64,7 @@ class edit_sentence extends XMLDBAction {
     /// 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 8903d4f..3eb5a29 100644 (file)
@@ -67,15 +67,15 @@ class edit_sentence_save extends XMLDBAction {
 
     /// 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 f1c3864..7851041 100644 (file)
@@ -69,7 +69,7 @@ class edit_statement extends XMLDBAction {
     /// 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 16199a5..f6b2f92 100644 (file)
@@ -64,12 +64,12 @@ class edit_statement_save extends XMLDBAction {
 
     /// 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 d45937b..90b4396 100644 (file)
@@ -77,7 +77,7 @@ class edit_table extends XMLDBAction {
     /// 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 329ca3d..72868f4 100644 (file)
@@ -65,18 +65,18 @@ class edit_table_save extends XMLDBAction {
 
     /// 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 ef2a5bb..98e60cf 100644 (file)
@@ -78,7 +78,7 @@ class edit_xml_file extends XMLDBAction {
 
     /// 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 67354a6..dc4b1ba 100644 (file)
@@ -61,16 +61,16 @@ class edit_xml_file_save extends XMLDBAction {
 
     /// 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 c672d29..a67bad5 100644 (file)
@@ -66,7 +66,7 @@ class load_xml_file extends XMLDBAction {
 
     /// 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 9228fb9..72f1426 100644 (file)
@@ -62,7 +62,7 @@ class move_updown_field extends XMLDBAction {
     /// 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 5846078..397c595 100644 (file)
@@ -62,7 +62,7 @@ class move_updown_index extends XMLDBAction {
     /// 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 bf5bb3d..c1019aa 100644 (file)
@@ -62,7 +62,7 @@ class move_updown_key extends XMLDBAction {
     /// 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 fe1910f..10a954b 100644 (file)
@@ -62,7 +62,7 @@ class move_updown_statement extends XMLDBAction {
     /// 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 25f3911..7470a0c 100644 (file)
@@ -62,7 +62,7 @@ class move_updown_table extends XMLDBAction {
     /// 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 5203481..54aa82a 100644 (file)
@@ -62,7 +62,7 @@ class new_field extends XMLDBAction {
     /// 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 559d328..47443b1 100644 (file)
@@ -62,7 +62,7 @@ class new_index extends XMLDBAction {
     /// 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 78a57ae..bead905 100644 (file)
@@ -62,7 +62,7 @@ class new_key extends XMLDBAction {
     /// 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 234e963..b6deaaa 100644 (file)
@@ -64,7 +64,7 @@ class new_sentence extends XMLDBAction {
     /// 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 6aaab2f..982d55e 100644 (file)
@@ -65,7 +65,7 @@ class new_statement extends XMLDBAction {
     /// 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 4aae8e5..c02a8bb 100644 (file)
@@ -62,7 +62,7 @@ class new_table extends XMLDBAction {
     /// 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 4721818..ca25a8b 100644 (file)
@@ -65,7 +65,7 @@ class new_table_from_mysql extends XMLDBAction {
     /// 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 0a7fd71..7046f07 100644 (file)
@@ -64,7 +64,7 @@ class revert_changes extends XMLDBAction {
 
     /// 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 8ca1058..c42ad85 100644 (file)
@@ -62,7 +62,7 @@ class save_xml_file extends XMLDBAction {
 
     /// 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 a2ddae1..f139fab 100644 (file)
@@ -62,7 +62,7 @@ class template extends XMLDBAction {
     /// 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 8640f4d..a12ae58 100644 (file)
@@ -63,7 +63,7 @@ class unload_xml_file extends XMLDBAction {
 
     /// 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 1ff0a36..f46fca5 100644 (file)
@@ -66,7 +66,7 @@ class view_field_xml extends XMLDBAction {
         $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 0ff21bc..9ade23d 100644 (file)
@@ -66,7 +66,7 @@ class view_index_xml extends XMLDBAction {
         $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 2780913..a973a96 100644 (file)
@@ -66,7 +66,7 @@ class view_key_xml extends XMLDBAction {
         $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 fc9d60e..16b0fa3 100644 (file)
@@ -65,7 +65,7 @@ class view_statement_xml extends XMLDBAction {
         $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 feb47f8..8e1efb9 100644 (file)
@@ -65,7 +65,7 @@ class view_structure_php extends XMLDBAction {
     /// 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 a49483a..97044ce 100644 (file)
@@ -64,7 +64,7 @@ class view_structure_sql extends XMLDBAction {
     /// 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 9151109..80ff3b0 100644 (file)
@@ -64,7 +64,7 @@ class view_structure_xml extends XMLDBAction {
         $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 c0f7da7..5851fda 100644 (file)
@@ -71,7 +71,7 @@ class view_table_php extends XMLDBAction {
     /// 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 e583b7d..5089a25 100644 (file)
@@ -64,7 +64,7 @@ class view_table_sql extends XMLDBAction {
     /// 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 56016c7..8f997d2 100644 (file)
@@ -65,7 +65,7 @@ class view_table_xml extends XMLDBAction {
         $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 d3be196..b1354a3 100644 (file)
@@ -65,7 +65,7 @@ class view_xml extends XMLDBAction {
 
     /// 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 c6398d4..a09ba11 100644 (file)
@@ -229,7 +229,7 @@ class auth_plugin_db extends auth_plugin_base {
 
 /// 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 @@ class auth_plugin_db extends auth_plugin_base {
             $config->changepasswordurl = '';
         }
 
-        $config = stripslashes_recursive($config);
         // save settings
         set_config('host',          $config->host,          'auth/db');
         set_config('type',          $config->type,          'auth/db');
index 0666724..5859c07 100644 (file)
@@ -906,9 +906,6 @@ class auth_plugin_mnet extends auth_plugin_base {
         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 9a42e41..538757c 100644 (file)
             //Set info_to save
             $info_to_save = "infile";
         } else {
-            //Saving to db, addslashes
+            //Saving to db
             $info_to_save = $info_ser;
         }
 
index 429e410..17b2357 100644 (file)
@@ -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 0b9fac1..f3543c5 100644 (file)
@@ -688,7 +688,7 @@ define('RESTORE_GROUPS_GROUPINGS', 3);
             $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 @@ define('RESTORE_GROUPS_GROUPINGS', 3);
             $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 @@ define('RESTORE_GROUPS_GROUPINGS', 3);
                     //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 @@ define('RESTORE_GROUPS_GROUPINGS', 3);
         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 dd694c2..6e742db 100644 (file)
@@ -148,7 +148,7 @@ $defaultfiletypes = "PDF,TXT,HTML,PPT,XML,DOC,HTM";
         <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 @@ if (!empty($types)){
             <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 a276110..a0f9d0a 100755 (executable)
@@ -74,7 +74,7 @@ $blogeditform = new blog_edit_form(null, compact('existing', 'sitecontext'));
 
 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 1a915c0..a49dd93 100644 (file)
                 print_error('nopermissions');
             }
 
-            if($form = data_submitted(false)) {
+            if($form = data_submitted()) {
 
                 $form->name = clean_param(strip_tags($form->name,'<lang><span>'), PARAM_CLEAN);
 
 
         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 28989e4..6dfe064 100644 (file)
@@ -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 05d7d94..423f64f 100644 (file)
@@ -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();
     }
     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 cf51ce2..0318851 100644 (file)
@@ -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 41aa894..64970cd 100644 (file)
@@ -54,7 +54,7 @@ if ($mform->is_cancelled()){
     } 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 9e0ccde..97da43f 100644 (file)
@@ -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 4ef2833..6b43723 100644 (file)
 
 /// 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 792c765..9bf6148 100644 (file)
 
 /// 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 6ad1aea..12e4188 100644 (file)
@@ -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 30f715a..732052c 100755 (executable)
                         //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 7814185..e6a20b7 100644 (file)
@@ -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 2715c85..db49319 100644 (file)
         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 92b40c9..3ddfcff 100644 (file)
@@ -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 efffa36..f171fd6 100644 (file)
         } 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))) {
             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 387f0b3..7564f7a 100644 (file)
@@ -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 a9ce454..30de125 100644 (file)
@@ -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 752c4c4..9c3ead0 100644 (file)
@@ -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 7a40318..bce5ea6 100755 (executable)
@@ -32,7 +32,7 @@ $mform = new course_reset_form();
 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 5c551ca..ffc0ca3 100644 (file)
@@ -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) {
         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 91d6fbb..325dce2 100644 (file)
@@ -655,7 +655,7 @@ function process_person_tag($tagcontents){
             $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 785fc26..8436ff3 100644 (file)
@@ -146,7 +146,7 @@ function check_entry($form, $course) {
 
     $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 @@ function check_group_entry ($courseid, $password) {
 
     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 1897d56..b143b1a 100644 (file)
@@ -31,7 +31,6 @@
     $data = new object();
 
     foreach ($_POST as $key => $value) {
-        $value = stripslashes($value);
         $req .= "&$key=".urlencode($value);
         $data->$key = $value;
     }
index 02865a5..7ed0b45 100644 (file)
@@ -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 27513ff..a0f0555 100644 (file)
             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 b83c05a..6a976f4 100644 (file)
         $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 587ebe0..5f9eac8 100644 (file)
@@ -80,7 +80,7 @@ $mform->set_data($data);
 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 2c5173d..e0870f3 100644 (file)
@@ -105,7 +105,7 @@ foreach ($standardoutcomes as $oid=>$outcome) {
 
 
 /// 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 380e383..a8bbe7a 100644 (file)
@@ -92,7 +92,7 @@ $mform->set_data($outcome_rec);
 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 550cb16..3ce3632 100644 (file)
@@ -56,7 +56,7 @@ $gpr = new grade_plugin_return(array('type'=>'edit', 'plugin'=>'outcome', 'cours
 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 d7be7d4..f909fc7 100644 (file)
@@ -92,7 +92,7 @@ $mform->set_data($scale_rec);
 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 f3532d0..c11c3c4 100644 (file)
@@ -56,7 +56,7 @@ $mform->set_data($settings);
 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 02ed33b..a28c8a9 100644 (file)
@@ -67,7 +67,7 @@ $mform->set_data(array('courseid'=>$grade_item->courseid, 'calculation'=>$calcul
 
 $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 @@ if ($data = $mform->get_data(false)) {
                 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 d958317..a0c77e3 100644 (file)
@@ -74,7 +74,7 @@ $mform->set_data($category);
 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 1e0e328..923e0a5 100644 (file)
@@ -153,7 +153,7 @@ if ($mform->is_cancelled()) {
     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 9109eb5..ad7d5b3 100644 (file)
@@ -101,7 +101,7 @@ if (empty($parent_category)) {
 
 $mform->set_data($item);
 
-if ($data = $mform->get_data(false)) {
+if ($data = $mform->get_data()) {
 
     if (!isset($data->aggregationcoef)) {
         $data->aggregationcoef = 0;
index 9190b5a..c77ea41 100644 (file)
@@ -100,7 +100,7 @@ if (empty($parent_category)) {
 $mform->set_data($item);
 
 
-if ($data = $mform->get_data(false)) {
+if ($data = $mform->get_data()) {
 
     if (!isset($data->aggregationcoef)) {
         $data->aggregationcoef = 0;
index 589fded..331216e 100644 (file)
@@ -89,7 +89,7 @@ $editform->set_data($key);
 if ($editform->is_cancelled()) {
     redirect($returnurl);
 
-} elseif ($data = $editform->get_data(false)) {
+} elseif ($data = $editform->get_data()) {
 
     if ($data->id) {
         $record = new object();
index 3916448..faf484a 100755 (executable)
@@ -54,7 +54,7 @@ if (!empty($CFG->gradepublishing)) {
 $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 665b953..ea78755 100755 (executable)
@@ -54,7 +54,7 @@ if (!empty($CFG->gradepublishing)) {
 $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 e187f53..b2d6eaf 100755 (executable)
@@ -54,7 +54,7 @@ if (!empty($CFG->gradepublishing)) {
 $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 6b9fff6..8b8dae3 100755 (executable)
@@ -54,7 +54,7 @@ if (!empty($CFG->gradepublishing)) {
 $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 c4ea5c5..8384875 100755 (executable)
@@ -89,7 +89,7 @@ if ($importcode = optional_param('importcode', '', PARAM_FILE)) {
 $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 @@ if ($formdata = $mform->get_data(false)) {
     $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 73c78d4..9ab857c 100644 (file)
@@ -89,7 +89,7 @@ $editform->set_data($key);
 if ($editform->is_cancelled()) {
     redirect($returnurl);
 
-} elseif ($data = $editform->get_data(false)) {
+} elseif ($data = $editform->get_data()) {
 
     if ($data->id) {
         $record = new object();
index 31a71c3..662deca 100755 (executable)
@@ -49,7 +49,7 @@ if (!empty($CFG->gradepublishing)) {
 
 $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 9a03484..7365207 100644 (file)
@@ -94,7 +94,7 @@ switch ($action) {
                 if (empty($trimmed)) {
                     $feedback = NULL;
                 } else {
-                    $feedback = stripslashes($newvalue);
+                    $feedback = $newvalue;
                 }
 
                 $finalvalue = $feedback;
index 64ff7f5..c2bb6f0 100644 (file)
@@ -149,7 +149,7 @@ if (ajaxenabled() && $report->get_pref('enableajax')) {
 }
 
 /// 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 b6dcebf..e0f007b 100644 (file)
@@ -227,7 +227,7 @@ class grade_report_grader extends grade_report {
                 if (empty($trimmed)) {
                      $feedback = NULL;
                 } else {
-                     $feedback = stripslashes($postedvalue);
+                     $feedback = $postedvalue;
                 }
             }
 
index b2568d7..3dd93db 100644 (file)
@@ -49,7 +49,7 @@ if ($mform->is_cancelled()){
 }
 
 // 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 2d1c936..01f7b65 100644 (file)
@@ -24,7 +24,7 @@ require_capability('moodle/course:managegroups', $context);
 $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 b42957e..427c60f 100644 (file)
@@ -69,7 +69,7 @@ $editform->set_data(array('courseid' => $courseid, 'seed' => time()));
 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 @@ if ($editform->is_cancelled()) {
                 $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 @@ if ($editform->is_cancelled()) {
             $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 8fe24f4..61d39ac 100644 (file)
@@ -17,8 +17,6 @@ $groupid    = required_param('group', PARAM_INT);
 $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 014d5c2..dcf1356 100644 (file)
--- a/index.php
+++ b/index.php
 
             /// 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 24e694f..ba6c92a 100644 (file)
@@ -545,7 +545,7 @@ function print_progress_redraw($thisbarid, $done, $total, $width, $donetext='')
         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 @@ class admin_setting_configtext extends admin_setting {
             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 @@ class admin_setting_sitesettext extends admin_setting_configtext {
     }
 
     function validate($data) {
-        $cleaned = stripslashes(clean_param(addslashes($data), PARAM_MULTILANG));
+        $cleaned = clean_param($data, PARAM_MULTILANG);
         if ($cleaned === '') {
             return get_string('required');
         }
index a94c804..0853a9f 100644 (file)
@@ -510,7 +510,7 @@ function blocks_execute_action($page, &$pageblocks, $blockaction, $instanceorid,
             // 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 8e3d750..f9a96df 100644 (file)
  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 e0f5f0f..648a4fa 100644 (file)
@@ -222,7 +222,7 @@ function get_recent_enrolments($courseid, $timestart) {
 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 @@ function error ($message, $link='') {
 
     die;
 }
+
+/// removed functions
+function addslashes_object( $dataobject ) {
+    error('addslashes() not available anymore');
+}
+
+function addslashes_recursive($var) {
+    error('addslashes_recursive() not available anymore');
+}
+
+
+
 ?>
index 65b9f2a..79f7ae7 100644 (file)
@@ -48,11 +48,6 @@ class mssql_adodb_moodle_database extends adodb_moodle_database {
         /// 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 e637326..cfb3e46 100644 (file)
@@ -57,11 +57,6 @@ class oci8po_adodb_moodle_database extends adodb_moodle_database {
         /// 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 e82918f..c862a63 100644 (file)
@@ -251,14 +251,12 @@ function rollback_sql() {
 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 @@ function get_records($table, $field='', $value='', $sort='', $fields='*', $limit
 
     $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 @@ function get_record($table, $field1, $value1, $field2='', $value2='', $field3=''
 
     $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 @@ function set_field($table, $newfield, $newvalue, $field1, $value1, $field2='', $
 
     $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 @@ function count_records($table, $field1='', $value1='', $field2='', $value2='', $
 
     $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 @@ function record_exists($table, $field1='', $value1='', $field2='', $value2='', $
 
     $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 @@ function delete_records($table, $field1='', $value1='', $field2='', $value2='',
 
     $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 @@ function get_field($table, $return, $field1, $value1, $field2='', $value2='', $f
 
     $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 2abcefd..7a818f5 100644 (file)
             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 83aaf53..f80305d 100644 (file)
@@ -1817,8 +1817,8 @@ HTMLArea.prototype._searchReplace = function() {
     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 @@ HTMLArea.prototype.execCommand = function(cmdID, UI, param) {
             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 204302e..0bf291d 100644 (file)
@@ -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 037324c..d8dc132 100644 (file)
             html_header($course, $wdir);\r
             if (($text != '') and confirm_sesskey()) {\r
                 $fileptr = fopen($basedir.$file,"w");\r
-                fputs($fileptr, stripslashes($text));\r
+                fputs($fileptr, $text);\r
                 fclose($fileptr);\r
                 displaydir($wdir);\r
 \r
index 8213a2f..223d9e4 100644 (file)
@@ -11,7 +11,7 @@
     @header('Content-Type: text/html; charset=utf-8');\r
 \r
 \r
-    $imagetag = clean_text('<img src="'.htmlSpecialChars(stripslashes_safe($imageurl)).'" alt="" />');\r
+    $imagetag = clean_text('<img src="'.htmlSpecialChars($imageurl).'" alt="" />');\r
 \r
 ?>\r
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
index e4cf9cb..2e48c35 100644 (file)
@@ -3,7 +3,7 @@
  * $Id$\r
  *\r
  * @author Moxiecode\r
- * @copyright Copyright © 2004-2007, Moxiecode Systems AB, All rights reserved.\r
+ * @copyright Copyright  2004-2007, Moxiecode Systems AB, All rights reserved.\r
  */\r
 \r
 class SpellChecker {\r
@@ -54,7 +54,7 @@ class SpellChecker {
         * @param {String} $str Message to send back to user.\r
         */\r
        function throwError($str) {\r
-               die('{"result":null,"id":null,"error":{"errstr":"' . addslashes($str) . '","errfile":"","errline":null,"errcontext":"","level":"FATAL"}}');\r
+               die('{"result":null,"id":null,"error":{"errstr":"' . addslashes_js($str) . '","errfile":"","errline":null,"errcontext":"","level":"FATAL"}}');\r
        }\r
 }\r
 \r
index 2703c10..79457ec 100644 (file)
@@ -244,15 +244,16 @@ class moodleform {
      * 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 @@ class moodleform {
     /**
      * 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 @@ class moodleform {
 
     /**
      * 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 @@ class MoodleQuickForm extends HTML_QuickForm_DHTMLRulesTableless {
                     $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 @@ class MoodleQuickForm extends HTML_QuickForm_DHTMLRulesTableless {
      * 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 @@ class MoodleQuickForm extends HTML_QuickForm_DHTMLRulesTableless {
         }
     }
 
-    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 @@ class MoodleQuickForm extends HTML_QuickForm_DHTMLRulesTableless {
             }
         }
 
-        if ($addslashes){
-            return $this->_recursiveFilter('addslashes', $unfiltered);
-        } else {
-            return $unfiltered;
-        }
+        return $unfiltered;
     }
     /**
      * Adds a validation rule for the given field
index ab25af0..177a7cb 100644 (file)
@@ -256,7 +256,7 @@ abstract class grade_object {
      */
     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 38f4572..beb7450 100644 (file)
@@ -197,7 +197,6 @@ define('PARAM_BOOL',     0x0800);
 
 /**
  * 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 @@ function clean_param($param, $type) {
             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 81bfaa1..bba7790 100644 (file)
@@ -975,9 +975,9 @@ function restore_question_state(&$question, &$state) {
     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 8b0ed0f..baad668 100644 (file)
@@ -47,7 +47,7 @@ define("RECAPTCHA_VERIFY_SERVER", "api-verify.recaptcha.net");
 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 2f50c17..40a0f00 100644 (file)
@@ -29,7 +29,7 @@ class search_token {
   // Need to think about this some more. 
 
   function sanitize($userstring){
-    return htmlspecialchars(addslashes($userstring));
+    return htmlspecialchars($userstring);
   }
   function getValue(){  
     return $this->value;
index 782b5f2..457cd70 100644 (file)
@@ -385,36 +385,36 @@ global $HTTPSPAGEREQUIRED;
              . "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 8ed4d45..e8a1cab 100644 (file)
@@ -449,20 +449,14 @@ class moodle_url {
  *
  * 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;
     }
 }
 
@@ -539,41 +533,6 @@ function stripslashes_recursive($var) {
     return $new_var;
 }
 
-/**
- * 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 @@ function get_slash_arguments($file='file.php') {
     $pathinfo = explode($file, $string);
 
     if (!empty($pathinfo[1])) {
-        return addslashes($pathinfo[1]);
+        return $pathinfo[1];
     } else {
         return false;
     }
@@ -1811,10 +1770,6 @@ function trusttext_present($text) {
  * 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($text, $align='', $size=2, $class='main', $return=false)
  */
 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_with_help($text, $helppage, $module='moodle', $icon='', $
 
 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_continue($link, $return=false) {
 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_box_end($return=false) {
 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 cc9a35b..94a9b28 100644 (file)
@@ -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 fe62cf9..c39e09f 100644 (file)
@@ -43,7 +43,7 @@ if ($p_secret !== false) {
         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 e1c59d3..01551bf 100644 (file)
@@ -90,11 +90,11 @@ httpsrequired();
         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 26f5d3a..a3e6e2f 100644 (file)
@@ -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 4015379..7d650a5 100644 (file)
@@ -179,7 +179,7 @@ function message_count_messages($messagearray, $field='', $value='') {
 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_search() {
 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 @@ function message_post_message($userfrom, $userto, $message, $format, $messagetyp
         }
         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 0751890..546601b 100644 (file)
@@ -66,7 +66,7 @@ if (has_capability('moodle/site:sendmessage', get_context_instance(CONTEXT_SYSTE
     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 a24a57f..c731a98 100644 (file)
@@ -1376,7 +1376,7 @@ class assignment_base {
         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 @@ class assignment_base {
 
         require_once($CFG->libdir.'/gradelib.php');
 
-        if (!$formdata = data_submitted(false)) {
+        if (!$formdata = data_submitted()) {
             return;
         }
 
index 0197090..ada594b 100644 (file)
@@ -502,7 +502,7 @@ class assignment_upload extends assignment_base {
             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 @@ class assignment_upload extends assignment_base {
 
         $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 29f89f1..484b6af 100644 (file)
@@ -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 82e9de9..17adb0d 100644 (file)
@@ -351,7 +351,7 @@ function choice_show_results($choice, $course, $cm, $allresponses, $forcepublish
     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 b486812..571efbf 100755 (executable)
@@ -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 25a4f3f..eb8262e 100755 (executable)
 
 /// 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 2a62ffa..ba68976 100755 (executable)
@@ -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);
 
 
 
         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 8ebaf21..ff002da 100755 (executable)
@@ -88,7 +88,7 @@ class data_field_menu extends data_field_base {
             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 86c24c0..a2519e8 100755 (executable)
 /// 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 1dd558b..5a5fc19 100644 (file)
@@ -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)) {
         
         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 c869083..8abb270 100644 (file)
@@ -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');
     }
 
             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 1bd14f1..3e3caf9 100644 (file)
@@ -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');
     }
     
             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 7f29f36..01c1e7c 100644 (file)
@@ -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 433c10b..0279ac0 100644 (file)
@@ -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 cd62883..22857c7 100644 (file)
@@ -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 7766b89..3fdd94e 100644 (file)
@@ -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 43f0db5..04b3079 100644 (file)
@@ -87,7 +87,7 @@ class feedback_item_captcha extends feedback_item_base {
         $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 @@ class feedback_item_captcha extends feedback_item_base {
     }
 
     function create_value($data) {
-        $data = addslashes(clean_text($data));
+        $data = clean_text($data);
         return $data;
     }
 
index e998e49..f62c9c7 100644 (file)
@@ -35,7 +35,7 @@ class feedback_item_label extends feedback_item_base {
     //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 43e7f70..229cf43 100644 (file)
@@ -35,7 +35,7 @@ class feedback_item_multichoice extends feedback_item_base {
         
         $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 @@ class feedback_item_multichoice extends feedback_item_base {
         // $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 @@ class feedback_item_multichoice extends feedback_item_base {
                 
         // @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 @@ class feedback_item_multichoice extends feedback_item_base {
         $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 @@ class feedback_item_multichoice extends feedback_item_base {
 
         $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 @@ class feedback_item_multichoice extends feedback_item_base {
         $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 @@ class feedback_item_multichoice extends feedback_item_base {
             }
             $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 @@ class feedback_item_multichoice extends feedback_item_base {
             }
             $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 e861281..71f90b3 100644 (file)
@@ -56,7 +56,7 @@ class feedback_item_multichoicerated extends feedback_item_base {
         //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 @@ class feedback_item_multichoicerated extends feedback_item_base {
         
         $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 @@ class feedback_item_multichoicerated extends feedback_item_base {
         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 @@ class feedback_item_multichoicerated extends feedback_item_base {
 
         $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 @@ class feedback_item_multichoicerated extends feedback_item_base {
         $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 @@ class feedback_item_multichoicerated extends feedback_item_base {
             $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 7328230..ef67229 100644 (file)
@@ -87,7 +87,7 @@ class feedback_item_numeric extends feedback_item_base {
         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 @@ class feedback_item_numeric extends feedback_item_base {
         $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 @@ class feedback_item_numeric extends feedback_item_base {
     ?>
         <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 58bc125..0b0049b 100644 (file)
@@ -65,7 +65,7 @@ class feedback_item_textarea extends feedback_item_base {
         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 @@ class feedback_item_textarea extends feedback_item_base {
         $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 @@ class feedback_item_textarea extends feedback_item_base {
         }
         $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 @@ class feedback_item_textarea extends feedback_item_base {
     }
 
     function create_value($data) {
-        $data = addslashes(clean_text($data));
+        $data = clean_text($data);
         return $data;
     }
 
index f41dca3..323b5a3 100644 (file)
@@ -64,7 +64,7 @@ class feedback_item_textfield extends feedback_item_base {
         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 @@ class feedback_item_textfield extends feedback_item_base {
         $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 @@ class feedback_item_textfield extends feedback_item_base {
         }
         $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 @@ class feedback_item_textfield extends feedback_item_base {
     }
 
     function create_value($data) {
-        $data = addslashes(clean_text($data));
+        $data = clean_text($data);
         return $data;
     }
 
index 9ba95bc..92e3b00 100644 (file)
@@ -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 e4c9a3a..ce163cb 100644 (file)
@@ -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 1673dde..9b07753 100644 (file)
@@ -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 1e94ade..f35b5b2 100644 (file)
@@ -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 ee13a08..8cb4e92 100644 (file)
@@ -2550,8 +2550,8 @@ function forum_get_course_forum($courseid, $type) {
     $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 @@ function forum_get_course_forum($courseid, $type) {
             }
             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 9ff69d0..300e0b1 100644 (file)
@@ -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 e052aee..373e378 100644 (file)
 
     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
                 $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 265b842..2952ed6 100644 (file)
@@ -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 7ad4ab3..014ae18 100644 (file)
@@ -59,7 +59,7 @@ function glossary_comment_add() {
         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 @@ function glossary_comment_edit() {
     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 a7f6938..3f2a4e5 100644 (file)
@@ -55,7 +55,7 @@ if ($mform->is_cancelled()){
         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 cfebff2..cf370af 100644 (file)
             // 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 f12396d..2dd714a 100644 (file)
@@ -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 14a0ff4..ab189ec 100644 (file)
     }
 
     // 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 030a307..cb9d775 100644 (file)
@@ -665,9 +665,9 @@ function hotpot_set_name_summary_reference(&$hotpot, $chain_index=NULL) {
                 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 738b9ac..266ee9d 100644 (file)
@@ -120,16 +120,16 @@ class hotpot_report extends hotpot_default_report {
                        $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 21f3ea0..7156b29 100644 (file)
@@ -78,7 +78,7 @@ function hotpot_restore_mods($mod, $restore) {
         $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 @@ function hotpot_restore_attempts(&$restore, $status, &$xml, &$record, $hotpot_v2
     $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 91185f6..e6a1dd0 100644 (file)
             $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");
             }
             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 ac27938..819e467 100644 (file)
@@ -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");
             }                
             $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 5aeda1e..d7d26dc 100644 (file)
@@ -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 9aa800c..2cc6a25 100644 (file)
@@ -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");
                 }
 
                 $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;
                     $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');
                     
                     // 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);
                     
 
                     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);
             $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 a2d82de..7891a8e 100644 (file)
@@ -60,7 +60,7 @@ class qformat_default {
                 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 d352732..9ef4e8b 100644 (file)
@@ -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 6c08d6e..43e1fcf 100644 (file)
@@ -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)) {
                                 // 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 eb8422a..8776787 100644 (file)
                 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 e95f396..856841a 100644 (file)
@@ -55,7 +55,7 @@ function SCORMapi1_2() {
         '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 5278405..c5e7a22 100644 (file)
@@ -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 lnea 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 @@ function SCORMapi1_3() {
         '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 6cef7b0..07766f5 100644 (file)
@@ -66,7 +66,7 @@ function scorm_get_toc($user,$scorm,$liststyle,$currentorg='',$scoid='',$mode='n
         $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 6f17c04..529df8f 100644 (file)
@@ -5,7 +5,7 @@ function scorm_get_resources($blocks) {
         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 @@ function scorm_get_manifest($blocks,$scoes) {
                     }
                 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 @@ function scorm_get_manifest($blocks,$scoes) {
                                 $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 @@ function scorm_get_manifest($blocks,$scoes) {
                 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 @@ function scorm_get_manifest($blocks,$scoes) {
                     $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 @@ function scorm_get_manifest($blocks,$scoes) {
                     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 @@ function scorm_get_manifest($blocks,$scoes) {
                         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 @@ function scorm_get_manifest($blocks,$scoes) {
                     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 @@ function scorm_get_manifest($blocks,$scoes) {
                     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 @@ function scorm_get_manifest($blocks,$scoes) {
                     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 @@ function scorm_get_manifest($blocks,$scoes) {
                     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 @@ function scorm_get_manifest($blocks,$scoes) {
                     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 @@ function scorm_parse_scorm($pkgdir,$scormid) {
                         $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 4e6675f..9424ba9 100644 (file)
@@ -11,8 +11,6 @@
     $student = optional_param('student', 0, PARAM_INT);   // Student ID
     $notes   = optional_param('notes', '', PARAM_RAW);    //&