]> git.mjollnir.org Git - moodle.git/commitdiff
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 9e150a80b7661410d1f4ca54ff94d8934e2053ab..4e0b2886eb78483ff1a3fdba6b70e388ede496d4 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 f54ed4a06bde740a66a42afbc0d955b2f40641ed..a46ab6264b7a0c47b04bc6cdce8bdafaa953dd57 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 f9fe5cedd9892ca4141a83702e1110634b7ce8f2..0ed836f7337549f9c857afee9d62bf42a9330af4 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 d9bb97988b0c01bdab0634ac7ba81e4dbaa6e2e0..3a3a697f5d1b36541bb579f6b6293b5f4d3857ee 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 72c61055c8395a3c953b1488380fe4919cccd855..b9c98e06684915480f7cc9a17228bf3ae42dab38 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 a4bfa1cdbc70066a159d6e1dcbeaa810d87e49fd..dc6729e890518b2d8e230c8bd22b899d04885f50 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 e5e4b390f8291b7ce74361033f7f8e8d51a4e914..e9c4e6e344bbc153be5757a2fcebe1599e27a5d5 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 f4ebaf85611e29a5ffdca1ff124cf35da67035cf..0bd1c9b49132f6526e33cf9232aed78c2fa2dd09 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 c2308faedb1aef3b9869d73e9de1b175fcaa9360..8c5455499f1493263198923a78a1b268cc7a47fc 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 bc43e9371a224aa4ae5889567a68e0d75ee24d3e..52dbae7442df5d3ea85430c0f1c7fde15e9fefab 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 321ee3593deb5f761882fecf0a10e8cecd832c9e..a281f1cec0960f86d7548b6ea46d04782681567f 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 180d8c33435b86d6db52d9bc50acdca017332d95..f566744af48f64aec831a5bf60c08041c81fa8a0 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 f9dc986a02d02ac79a422d5e7338217ceb297e8c..4e8df42be21e69e8f4afd9a4f1bc5e77f659974b 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 cb05671e4ba0fb453dbf857022c61cf29ba8fc98..eacc00d653961cf3b10b0be5f04ad79b924beb36 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 e52236290cb7761e3bd5f7cb4358771b535b0171..254db546f46f52f5c398102c3ff8f24bf84466f1 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 72359f73d6e3026c6645dd7189fa1af0413a0c42..bdd55f6056d8bbf62815b4a3c5d4d95430948428 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 a8ee38ba2fb7cefd1677143e6d6d4893b42d8579..f3b5557522afa4206b891cf1a80b9832b53ae839 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 d0f771f77b8498f269b5fca14fd876c3ab3e679c..1ee435828488e8813a4b2665e778b65ef85389b8 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 6d4d5e10fa4cc23ea94d5491581b5f963bcd3cb6..65fbf3c4cb1eab14aa3dffdb5630a52daf2ff7b7 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 e9e82d9682043d29c178b94dbd32cb9c190c2f6f..e8122bf6f19870325f43df6b51f095e767c9682e 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 ba81acf10ec693999dc958aa9cb2cc036dea06e6..1a83c4a4da65a87428c26af7fb1596ab79ca58c9 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 ae13d7c92941f82d28a46d96e9514c7fa63ffc3d..acd9a4f60fc153a829e09591287b1b3d4c10d927 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 163623effd3e868efd220d18fe6733789411be5b..df433f7d1b5267606b0de3f8a6bf5bcf81914f54 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 bac02b6c7146d1e4b222592c2671686e2d3dbfc1..4c7f2d54c36ab8d96df4bc08d5922d054b7e74a7 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 c1eaa9364bc1c8b0348f710d1652a5ba99e0b737..201e67621f612f5e2c9d7361de1fdcd361271721 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 f4fa4870f5367d0144368256f5b1d6fbc8f0ac02..03f36b88edc7a5758502d4a787faa74227d18003 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 1cda159f9a392091f3ac1038c66c2df2157380cb..57ad55ecc3cff2a5728d9a4dd3c345376e8dc2c7 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 8d125c6b1412ccffa1efa1345cd26a76cfa0ddb0..d9ff4e3610b47c71f675f2f1cb7149fcd12f3b33 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 b5c5f53150d2281ba3915968cb3ffb756c0ba098..f6bfa878ff0560e12b0947091bb39b120ddfda3b 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 41d7a65968a25ae918b39a9a01f9207acc3f687f..6b6a8bbae67291d7bb83afa313032a3882fb9f7f 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 434b13e48ee8b32cbce259e8d5eff41cb0350ea2..95f6149a89359bb5050c83ec047e07a6bb922c25 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 629eda4d8461b080711cacc58e271b3d3e0a51f9..b03d01f1e612f666a41f7271c27cfc13022b50b6 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 0a21ad79f2ca9f5ee653ead91e68f03b8387636e..7a4d56f3a8287ecc25600f557269c9b6603d5280 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 04d79469ef7acbeed9cc5bb081d67f8fd404c1d5..78f8812905d19f115362299fa60e86c5b81622e3 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 512b6c7c08c7445efa2a0687f97d579106716580..7a842fa85a4b35a0e21b50e13abfc8f05495016f 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 7422b2311f51b78728d70e3be738c7baf9494f83..9ba4588f3d7f0bc0d86c0260eab91633e36fec9b 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 4d8f13942b351c230027b67d24f95e9a8c24e0df..6a047f956c1210721e72d41be8f017068db82741 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 7858711939e27c717150ee5cd14394dfbfe4e5bf..085fd719968d8718be92cd38bd5193e34b1c5a42 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 3f3ef0af315607f5d0a281edca507ef628b57ac4..3e97985a3c99ba6a2de2bdafc5d5c50fb7c76f17 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 d72d1699a8dc42c5d35ddcc261725c616b48beb7..c8240ea33e8fff9d8d7b3b9bec7dfe845adb296c 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 8903d4f17754c3da9ed02840655342b142f37d49..3eb5a292e594d631f3d87f58198842ce416a6669 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 f1c386461c7395038cadfd95564bfb88a864ab71..7851041c920120d9e658cbfd17836d0f6029a960 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 16199a5a4c53f7a48335849eee0b540ff730682e..f6b2f92fea1f436e1e547f1bcbf6dec5388c2b36 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 d45937b05fbbb4ad5f45da07691bcfde994705aa..90b4396ae95bd9b84eb759be4012f93a9d7f4b76 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 329ca3d02ac30814a815f487eda87fae623b013e..72868f4362637564c700939ad8db1b5d2673ee94 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 ef2a5bbd27d233eec2f580bf05a47dd111a9e45a..98e60cf1bc298fc717e7610390809c39d3f5eab9 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 67354a6e560c4fd0c2eb1652c72653416735c723..dc4b1ba4e65358698899a608f07af74b4974bd73 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 c672d29cf15f1215fb636e54874b12e3e9710e75..a67bad52a4029de1557ecdc00dbaa71186f45890 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 9228fb9d9e130fcabcf7c6107b28533a06947ded..72f14266913f7c5dec3625d8ceb06249945ef5d4 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 58460781580382a47fcca508ff97007b5aacaa93..397c595c3d5b1f5a6479a0339cdfc26721f8ad3b 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 bf5bb3d5f45e50218ce4013b9c30449ae1047763..c1019aa3743b1ef7d7d6c37b9fb6b1c98d190255 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 fe1910f97bc03714f0d63a04b7ae6964f21cafc3..10a954b0c339e3029d0e4b07d57eb126fdc7af84 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 25f3911e09a705616e200bb9a5f3575eccd75a4e..7470a0c668cc74edae7ba5808de3f5e51938f1a4 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 5203481ec131bd0fee2bb98a4b1583f790cb7266..54aa82a681a91421de5c41c0dc171d281c7d4e97 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 559d328ee3c2e7afeba5963683dd25847d30ff2f..47443b146c6a9fc4db8371b1762dac1f366c2d75 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 78a57ae1bb5c6b9792c7264610886ac47f5154e6..bead9052e5e9132bec388dec08dc6df828ada7c3 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 234e963e40fa6c26362fcc87523320d6d300394c..b6deaaa6ff18b4b3d6212d59f298c220347614a4 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 6aaab2fb2cde92938cfb13c45f6d85e67be975eb..982d55e0a913c088ad59f3e486e88dad34a14cfc 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 4aae8e5b53eff8282d3c471254a25491498918b8..c02a8bbf451545a254c803f81ddaa8ff63cc4ba1 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 4721818d1058984a3206e847db002a321c91cbf3..ca25a8b3eef5a2e00d40f836df2e29884eab7452 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 0a7fd71de6e6271b2378d559e6d290d6f6f1b270..7046f07012467addf1ac5b7753e373c87ee5eef3 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 8ca105834189cc8d15808f2d8fa7b005c5697501..c42ad85b1f9e3b4b7811b7fba09ba52fb13ac83b 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 a2ddae101f445eb82f62d4d078d82da8206b0936..f139fabfbf039cd225258210c73059872d06aa34 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 8640f4d9ef2338f71817f3f8e9a5e0fd4a803012..a12ae587c664b6f2cdc1285568fab81f2214f136 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 1ff0a36c57b4d38a70acca9934ce208ab6ad0d9e..f46fca549fb475bee77eebc4f62588c3e266c26a 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 0ff21bc657938efedcca684dcf0c3042c57b562a..9ade23d3301e5e845ae8af1698cffd828d5e8ff6 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 278091356449a1540cf3676694886db66c474f06..a973a96dc8c1e1b9d8b280d574ebea3a4ae9fb4d 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 fc9d60e8163f4bb5c85eb7d1d6d5f87233a210a4..16b0fa3ef8bbeb1bb8091c8f2fd69025b316d8d3 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 feb47f82adc02c38f2e749499d9c9afaebba571d..8e1efb9d67421345d3f6902e8b354ad5772001e5 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 a49483abe2bad1c968f73f18289ec6093885e8b2..97044ce88cb20d9551549fb36ac7b2ef8d3f6453 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 91511095fdf1257bd8e945e8a8b8d22e26b4962e..80ff3b06530bc0fbe0ad14432fee26838abed972 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 c0f7da7fd2217d4d342060647b667bfbf4f7c86c..5851fda01b71e590585b9b3c26dcaf7ab7d98f4f 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 e583b7d7230b6fbbf71ec10365d9950a945e0afe..5089a2554d215a1dd1c126e863bde2e58147b9a6 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 56016c7d55d28a982137fd28e0cce773616ee113..8f997d259ed8e65b58cc03ee224fbce3171d9583 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 d3be196aea3b578e583ce406664c9f7bbd2aec31..b1354a3098673cb4f9e02d397890f2dd0ae662ff 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 c6398d4a266964c12e5092e0bd22b79175290a2f..a09ba11ab0a8d3d598d56607df7754defd687217 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 06667243c48f31241395993e2a76e2f99e03eab7..5859c07f4240f7dacc8f094fc51f424116a22e60 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 9a42e410d061624ec0c95c47a4dd62300a768c0b..538757ccd4b7e5a5afefdaf4504a31d20b352fa7 100644 (file)
             //Set info_to save
             $info_to_save = "infile";
         } else {
-            //Saving to db, addslashes
+            //Saving to db
             $info_to_save = $info_ser;
         }
 
index 429e410c517bccfddd234e5040aedfdd9d71c05f..17b2357d5947e766f320c1c5b13051db15720e91 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 0b9fac102ddaf4b3853bdc8b0de61825205dc33d..f3543c5c46e30096b763d3cbcbd095ef930729a6 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 dd694c207a9e34b4fb46aa91e5bdb60e3a06fc49..6e742dbd05abeb9d0a2f06a42b9dd68ce0ccc412 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 a2761100f6f7785fc4bb01352295c144572a2e6e..a0f9d0a4ef948149880e27bf664dfcc2f135b3e3 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 1a915c0f6defffe4d17ead24c895f8c38b4db981..a49dd93af5e97e7303a461aa0d3ab8ad18eb94b9 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 28989e413a6f0ea7861a997da27d27f81a052fea..6dfe06445ffc683af63e14874af4d9394e6d3273 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 05d7d942b3ac22dd58fcdf51618e9e810dd317d2..423f64f9e2b1e37ab3c10ba5be12337de8edebb5 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 cf51ce2838bf2649de5d37cdbee96df395361d9a..0318851b10b64a62597552e31d451c7eeeae140c 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 41aa89431f42bf232e5241ec633050dd651a83a5..64970cdc7cc1300f7663d4d608f102e0cfff1bfa 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 9e0ccdee89c1b7547521a5599f38e0534b8b61a9..97da43f1f40f06000aa57a4872546eafc5e725ca 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 4ef28338b0ed34c703cae50cc62c738bac8e8761..6b43723dbd24b5ec936d81c2181da2d3420d5cb4 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 792c765751dbe40ad56d742f3b15b73502fdfa10..9bf6148e396d770f5b18d6e10082a27ab97a34c6 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 6ad1aea6f0ea91de073c1606c4d30a8275937e32..12e418889f65f21b0d37e117a8d938b654bc71e4 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 30f715a292911fbbb590958b7907b3c5a409466f..732052c94c00beb2e6d1877259b530d0ede0fb89 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 7814185ba69b81f8a779857b72febc13f5fd63a7..e6a20b7669d53bab261ea26c104289309153c757 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 2715c8534873853b5994f075a9ad313933a9ce42..db493194980af1a7687e04bffe000ffd0ed9a426 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 92b40c9b14ef646f2589e6d3985789ea48cdbf18..3ddfcffb1753a8ff46f669ccc72d9c63ecdf3b6a 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 efffa36d33dec744c709bea0c54cac1da3351df0..f171fd609d8e8570b2980988928d022130645b61 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 387f0b32fe44c45c2a371df076f6c571e6b5b07c..7564f7a541053864faa439d21156e60f296df337 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 a9ce454b2f766200e2a21036403ae29101719ce8..30de12596f2d28dcbf9cb904c51ea9213eb11bf4 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 752c4c43f6533ffbeb2d8c8932a5d26e0bf6b01f..9c3ead040ce469e7bbeeb3ea0f42ea4267995362 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 7a403188cfb603c7592cded963edd389ed59a34d..bce5ea64ba7c5d614c1f689e67591118749bf0b6 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 5c551cacebcb14fb71e66aa8b4fe193a2bfce4c2..ffc0ca31fcbbe90dd9ba296f8ce4929a0fde5933 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 91d6fbba34874b290542adfb6bd5c0aed9af4286..325dce251dcbd277e19a3bc8ad9b5b9246863249 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 785fc2630d8ee62189f34131d9cbe0c4a857cfa4..8436ff321b4c3f5c43a80e0149a3b548fcb57dce 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 1897d568a5af27ad07638ea39439b8d514be8ac9..b143b1af435b3b2b664ced3b1eefc36faae89aa1 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 02865a5a206429bb2c8d9d9f78e664454162e631..7ed0b45d8fd5cfdc654093f12bc0ca8bf0bc666c 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 27513ffc42465367f424a4967387688933134166..a0f055500b8030eca64c5e1dc3eb00309b2dc994 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 b83c05a7a41ac61ec15e5195ce3905f53db80b63..6a976f4da13f0ecb78e1b6f1c1bc8fcf623816d7 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 587ebe053e0d7d0fc533e4875f761c21b2bd193a..5f9eac8e5992059277bde6306e63ea28f3951983 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 2c5173d25d454c1435b0088f4c632696541d3c4c..e0870f3504db1b2ed8a09e9b7b27b839b740700e 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 380e383aefe460b7abda1bfc7824bc0ea46350fc..a8bbe7a5263a4e223fac10d05363b54255824add 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 550cb16e00266a1a63447a50a45b0157af0250c1..3ce3632ac6d15eb60e78d47eb7f863193472bd57 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 d7be7d4c833a460cd14239e3af97fe4060a345b6..f909fc7202a92710d939cefafcf905b215b97309 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 f3532d0c1f4bcd51b3d4cd5ad667d6a3d6425304..c11c3c467cd3a3e9e9f2bec310bb0ca61db1198a 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 02ed33b6d70150847b3efd05d9b835de52d3d1ca..a28c8a9ceac5cd9bfd91035cc61156c879768d99 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 d958317516a79263585808048eea463c8d370229..a0c77e3c4814c123dc5f79fb7ec34f7f1e1a2a4d 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 1e0e328b5995057c6520e4da2a2299be203681b1..923e0a5af601b298f6d7d0e3f11d97e22565eb8f 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 9109eb5cab70f18dad6ddb218f11c9292070919d..ad7d5b3971466fc997cfd27ada0137f81585e322 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 9190b5a16af166c01ad49d611186dbe71ae510ad..c77ea41748a171850f6eae4bb55e15db44f170f7 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 589fdedad0e0944c9a46c031b86df8608e1fa871..331216e1f4459f3ad8f5d3319935af4e94e92432 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 3916448626e64fc2df54fa46ba2b709e5a7e0df4..faf484ac4ab41a8af3c54b52920f09ee46648072 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 665b9535021e9930f749fe98d8b58535b8bf11c1..ea78755adcca7442b362dd6094c324f7bd6cddb6 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 e187f534ef0544371b10b5518dd6a5612bf8c7ad..b2d6eaf916d0ff3d921b6b9781061147c1034a7f 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 6b9fff641f104b3ddc413dfd82d50e5cfe141fff..8b8dae34a2c21cf4f396ce3c41979b682f0df966 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 c4ea5c502dad97bf0e4895d1a307bdc83d907dc8..838487550e35db763e61deb56c1d612826924e1c 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 73c78d4fd9d3696b30381790aabf723c31ded10c..9ab857cf100a3210861e6eea9c077fd5d8261e25 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 31a71c3baafa462d0672c8ba4fccbcc77a987e19..662deca097f485b88b472ceaca4bf2bb7495ad96 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 9a03484d62be8b078dfa142722f0570806fe7a2e..7365207f2384cf04f70ee54dfacf1fdbf2688497 100644 (file)
@@ -94,7 +94,7 @@ switch ($action) {
                 if (empty($trimmed)) {
                     $feedback = NULL;
                 } else {
-                    $feedback = stripslashes($newvalue);
+                    $feedback = $newvalue;
                 }
 
                 $finalvalue = $feedback;
index 64ff7f53d167f67e994c3d16184039b3344576ac..c2bb6f028c3cb1fe513428567bd8716f504a5681 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 b6dcebfc0de512f0bc10be22f41c9c5f07ca5f98..e0f007bc7faf6c7a0c21077f54562a95e41def33 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 b2568d76623dd24d8e46aef6fd93ffa3d78c6501..3dd93db9a4db6934072e4c465ab8ab83d984176b 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 2d1c936667c5322c6b12c0c612073b05732c0e98..01f7b65b465702bed67973f9d9e5406f6c3d2146 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 b42957ec56399799d3abe375592757fe6de8295f..427c60fffd0ed59a28315828fabaa2761bea8ba6 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 8fe24f406078323c870a8d811234c54e445370ae..61d39acbb7a8fe97cc469cdc3968d35b13bba610 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 014d5c292df4d65a810d0e14fd287bc6442d96b0..dcf1356d1c583b9900fbfd090becb0301c410e09 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 24e694fb67cf5f742a80246c7268ec098969c089..ba6c92ab6fc38e25ad867b6768c1d594f70aa1bd 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 a94c80420eb0a65c710bf342de56c076aa5231e5..0853a9f293c60351384b0f65958972f1e654ae3d 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 8e3d7506e25ed448d9e2e5ca3f09ffd66bcf6686..f9a96df79b24f4516b8fac24d5a61ece36e2244e 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 e0f5f0f81c0eaa6db8dc11dd15b1bc8f4b6b65aa..648a4fa0da9aa37757e702a22e2286b79d1a5b34 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 65b9f2a7fd880cb03ae2bf32e2dccafc8d4339e0..79f7ae73b39af938a004aa2043c3a15ad33edda4 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 e6373260ff05e313a5b06afba37b71c50d57e578..cfb3e46333be0a36727a69bc67727869a2bb88aa 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 e82918fc6a9ec995a6ce29ece9f53b3af33a219b..c862a635ae9f2a3717863644b43ed3d8053ac4d8 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 2abcefd07a02063a559afddb22b280ebcf0294a5..7a818f50d2cd5dc39729e8be04dd7de3902e715a 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 83aaf533b272267b387bc9a725d6e2ea6ce4f4ce..f80305d0ad61493bec1fa1be5d2e8aa0dedc9d0c 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 204302ed104b10155bb3e3eadcfee4dc882dfe5e..0bf291da72537a97fc386b1d52656c0bdb5bd54e 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 037324c8d331e4de8930f406a70b8f4e290641c7..d8dc13265c58221353c16721f33ec9a8f4444421 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 8213a2fa0e8b25f96a2c15e06b68406f14465d2b..223d9e488836d2cfd1e81d9c2114668e6b960722 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 e4cf9cb9e9b0baef199fbcb43044c94798c1aa2a..2e48c35717b853b95d2d3a4ec07df951cc76fbc6 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 2703c105e007549859dab3adb75abeb514497965..79457ecee3d4cac193279300bd5f126b7159c6d2 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 ab25af0e6bb681211f492b0d783d3068f5ba187e..177a7cb3c919042834089d0363245929540fa600 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 38f45727d236df5a238240ec6cb39d1fbb9c1ed4..beb745027c10377b25a131c34342dac18ab2085b 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 81bfaa13cb573b644991adae8b8d21f2709b5635..bba7790722d96d7781a09e61a9ca904225e0b60a 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 8b0ed0fb58cffce71edfe2223ceb514fac3f11c9..baad668883d01d88c640a8be561a18fc4a0c0579 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 2f50c17f4aedf6d155572155ca4b830dcbac6d91..40a0f000ccfe9bc7c9378aef093dde9ab086df65 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 782b5f2091e0fea9bd7b2f32ee4734440e17fb75..457cd70118043441de70f4992ea3a975270c1e64 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 8ed4d451cee1c5906cb62d4341e45de6eb630996..e8a1cab486ce1d930dc70fce65eda20f61d28808 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 cc9a35b8564704052800b644e955a0a166ae1c28..94a9b28b96b99500347c3964769ba5c40f7b3870 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 fe62cf984782f8248f3e947992081f3f8b1354ea..c39e09f94aa79702568ed76f7e87e3901ab56adf 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 e1c59d39edfa4b1beaf3d63ece13e66feab369a4..01551bf4dbdfda8086b43762db686037b73084e9 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 26f5d3a2ca0de9caf3d2ba4be2bbe5cc73c13487..a3e6e2fcbe54e47d8ccbfff73a4ed3b00b96a137 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 4015379f722ae0f4b3469d1f3966e1445734374d..7d650a5495763001a77088bda2ee7f5840c30b11 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 07518901ba254609f4d33607d3d3f070c86d9552..546601b65e00ac8093b3395a4c7fd907dc50ad51 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 a24a57fc9875cd32d8891986fb1a2f16da665985..c731a98a219d216eb90f841b79fbb653532beded 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 0197090e2c7c992fa81243a0eb6018b5e0dd860d..ada594bee79307f45dea9b5c6f6fe0c4429b8ebf 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 29f89f1a20969cdfd9a4b1a4ff41a9d6e9ac2376..484b6afa0ca5ec892415fad0946dab5ba26ff732 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 82e9de9aa78c141b94814d5489e7b9c8a0258374..17adb0d02468ec3bddcf15aa4c7f0fd99defb5b2 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 b486812535b952881385f52a0f08216699a2baf9..571efbfa6367d5ec98b05fe6714f7ba28240496a 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 25a4f3f512e42f92bfafb6baf6d2391f4ffc2cf8..eb8262ec8f842b8963707c2e287de135b450e101 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 2a62ffacf5142c82b750490bbcfed73553171f33..ba689762887538ae673507e5fa6a893e234f714d 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 8ebaf2119a24d95306e0f3ca5dd7118556339900..ff002da3ed0e3d80151331be7526d9cebd802a44 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 86c24c0e2e0b2edb656286478d55b378db12cea2..a2519e8c4d16bab9df8554de70a71b549ac496ba 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 1dd558b2d094b710419ced58faa7639f57baaf4f..5a5fc19d5fe316e11f5cc45f4f14b0d20d5c04e6 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 c869083347f94c996cd71257331ae5cc076309b0..8abb270fa6e4007b6f8cfbc27d3f0373acbbbd2a 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 1bd14f1494f0b7fc28306a8b75dc3857551578ab..3e3caf9f733f39b7949e30e9e3f92e4d5cc3be6c 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 7f29f36923d1c9adf42cedaf7b8515a5ce8bef23..01c1e7cd7b8d6d65ea5a49e1ac5096489e6015ff 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 433c10b87486fbd7b7ac833a7a1d33158c0deb55..0279ac0797ed8127d9e3ab805e0c479a5e204f17 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 cd628833937438c9ee61c2c39264330d675cd4ed..22857c7bf0d0c1d1a569fc16b576a017159ab755 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 7766b89d6df6589a28d6d92964a0fc575027c323..3fdd94e5fd6dd86896ef776a1bfd7d84fb42e708 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 43f0db5e66ffc66fc3c0e40499ea5f936428af12..04b307940fc9e2ad956c339a946e15f46b50118a 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 e998e498cc480b2bd1109aff456b6a2ea8bf357a..f62c9c7a4c01c527669518f9e46cd71d78e058a9 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 43e7f709d6216a9b8d0213a430e432dadeaf7589..229cf431db54dd4a68998096a0b3f4922746f08d 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 e861281b60f64d800d7e424b54d01dc294349837..71f90b3f4e996f36cdd84f0de1d7e7fbaca73ffc 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 73282305ebd3f3edea1d6c6cccd61ab9410f8f91..ef6722965983bffdd41fab86a650826c1f555a3d 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 58bc125b12fb8cf25f95d0c63a60236ce90265ea..0b0049b6b0474dd73941b3d189ab1670a86d08c1 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 f41dca31d61726fe8896a82edebf412876f9cdb2..323b5a3ecda88f83b49a21af1e568ddd576b0fa0 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 9ba95bc5a0c49379ab6d988b44a53a4fa6bdfc2c..92e3b002e294edb0f3dc92ea659d69fc381f66fb 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 e4c9a3aa33279441b4729121f36d58e7bf8f428d..ce163cb34e46d06cf9b00205c6410accfec33ac0 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 1673ddea4ceb5137929d41314a8d4b5ea55cc11e..9b07753be7ddfc1715401265160a5961fa943781 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 1e94ade7f0827740f852e0bbdac033fb10f0a6ab..f35b5b26fecd0efff72528035f4137b690b4196d 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 ee13a08e9ce7a98d7e49f4ffe594502b8ea3dee4..8cb4e9208c1d3b88c4393d5c3f74cc9fee782a00 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 9ff69d06292bf141f14137d1698c56693ab712bb..300e0b1adf782969b8469382d2bae4c53b09ea0d 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 e052aee190c39bed74ddcca2c67e8b1cb6e76670..373e37853ad5f7258cad89a90581ac2d3d857f84 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 265b842cc078349da1059874367e44fa0e05cf98..2952ed6be88f5eede5555c36b57ecd85af3afc9d 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 7ad4ab35090757ff395c557a897ac50cbd882714..014ae18ea86392f3444aaa56084b773879686382 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 a7f6938b8c95ec7822eb90b765acbc10d9ae5f5e..3f2a4e56777fcafc4cbbe914fdaca5c8836f831f 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 cfebff2f0a61fb776bd972bf729d1b1748bfc74c..cf370af47a6ad1ad8ed930948c7d1e3405f4f13b 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 f12396dcbc6d84fb159ccedfa3fa31559447c27d..2dd714a73cc4951134d0244bc636e611c42226a1 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 14a0ff4e8342a77955c66bdaf65ff656007b2ff4..ab189ec2930fdaf85aa882ea3f9313239d33ae4f 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 030a3078342b3053f957bb549bcd44e50daed610..cb9d7756985565fd8bb949eab2e69467415d2d4b 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 738b9ac358cd16d4d52b24ee6a6985d4826abdec..266ee9d21cb5a79bd3dcb60a2637e351b3e290a4 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 21f3ea0811e567385419a1fdae5273134c77f85f..7156b2992834c8601d57d537ed2c602a4ecb9024 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 91185f61abece975f6e264d6f9b30a5d82044bf5..e6a1dd0ab0b63c9af37a5c41ec29767fb643b59b 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 ac279383fc6da81d6e44a1761512a0e8b0ec8988..819e46704cf4e2691136f7b8ddcf3587c5fc5248 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 5aeda1e58c224f2fa8cbe5579d81640b0bd5d207..d7d26dccc945a8f95889c28fc5eeff986d07978e 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 9aa800c21be45bf6944acaf9d810ceb13cb24b5c..2cc6a2596999a24f72e4d1236ca246564a8f80f4 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 a2d82de8dd9fd507f5b726c0777a9b703a8af0a4..7891a8eff0872e77eec3992a8dba02e0423d9a8c 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 d352732f228fd5d8aaa2b35e117edebbee1ef280..9ef4e8bc46b272a0c70f0e8da2c1630540660bac 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 6c08d6e5c03b912ca8c8be572f606cab08d7a238..43e1fcff21034249f38b718b1e0a38288632300f 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 eb8422a522ec30984ec0d94bc398c1f7fc07a31d..8776787db1fc0b31a1e10b32521095db2ba7ff4a 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 e95f396cadaf78cb3314465db58c2d0b3903f07f..856841a5c8296003d4a55c0aa0dd262bf622eb5b 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 52784050f259a0c92f34d0a6d6cfde1f073df85e..c5e7a22aff80cd2b6b4c30ccb1722c15ff208f59 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 l�nea hasta el &&
         if (!isset($userdata->{'cmi.exit'}) || (($userdata->{'cmi.exit'} == 'time-out') || ($userdata->{'cmi.exit'} == 'normal'))) { 
                 $userdata->entry = 'ab-initio';
         } else {
@@ -140,7 +140,7 @@ 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 6cef7b05656f418e9addb294973383327a206e6c..07766f5b336b1b15a440b95ec740824277405546 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 6f17c047c61a963d551f21452291f79aef012185..529df8fb4868b071bcf99bf397fee06469d326a3 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 4e6675fa5f5b35796e35b0a6cf0e06cc3db809a3..9424ba9a410c5ab90468d4eb822f156bacfe2853 100644 (file)
@@ -11,8 +11,6 @@
     $student = optional_param('student', 0, PARAM_INT);   // Student ID
     $notes   = optional_param('notes', '', PARAM_RAW);    // Save teachers notes
 
-    $notes = stripslashes($notes); // TODO: remove soon
-
     $qids = explode(',', $qid);
     $qids = clean_param($qids, PARAM_INT);
     $qid = implode (',', $qids);
index 18296556cc8b2db78ca31a099f6ed7564bfbca61..6bbbdea4628a2e04874f7abc78aaccb7bf331632 100644 (file)
@@ -6,7 +6,7 @@
 
 // Make sure this is a legitimate posting
 
-    if (!$formdata = data_submitted(false)) {
+    if (!$formdata = data_submitted()) {
         print_error("You are not supposed to use this script like that.");
     }
 
index 9dc1665c87e47a53868e6702a7a98900a5388ca8..97b3bd8fbddceef980c0469a153aaf601c2b0951 100644 (file)
@@ -310,6 +310,6 @@ function ewiki_database_moodle($action, &$args, $sw1, $sw2) {
 }
 
 function anydb_escape_string($s) {
-   return(addslashes($s));
+   return($s);
 }
 
index 67eb34c04c93316bef784f0af372c61a4823d62c..be1062398b9c58c3c41b30f078b77481987ca0c6 100644 (file)
         define("EWIKI_PAGE_INDEX",$wiki_entry->pagename);
 
         /// If the page has a ' in it, it may have slashes added to it. Remove them if it does.
-        $page = ($page === false) ?  stripslashes(EWIKI_PAGE_INDEX) : stripslashes($page);
+        $page = ($page === false) ?  EWIKI_PAGE_INDEX : $page;
 
 ///     # Prevent ewiki getting id as PageID...
         unset($_REQUEST["id"]);
 
         define("EWIKI_INIT_PAGES", wiki_content_dir($wiki));
 
-///     # Moodle always addslashes to everything so we are going to strip them always
-///     # to allow wiki itself to add them again. It's a triple add-strip-add but
-///     # was the only way to solve the problem without modifying how the rest of
-///     # the module works.
-        include($CFG->dirroot."/mod/wiki/ewiki/fragments/strip_wonderful_slashes.php");
-
-        if (ini_get("register_globals")) {
-            #    include($CFG->dirroot."/mod/wiki/ewiki/fragments/strike_register_globals.php");
-        }
-
         # Database Handler
         include_once($CFG->dirroot."/mod/wiki/ewikimoodlelib.php");
         # Plugins
index 00f4ed77d48cbc5fce7bafadbe65b6fd15487a98..973ffa5ea7a02511f946854ea5dd0d3bf3cccbb5 100644 (file)
@@ -39,7 +39,7 @@
     }
 
 /// if data was submitted and validated, then save it to database
-    if ($formdata = $noteform->get_data(false)) {
+    if ($formdata = $noteform->get_data()) {
         $note = new object();
         $note->courseid     = $formdata->course;
         $note->content      = $formdata->content;
@@ -55,7 +55,7 @@
 
     if ($noteform->is_submitted()) {
         // if data was submitted with errors, then use it as default for new form
-        $note = $noteform->get_submitted_data(false);
+        $note = $noteform->get_submitted_data();
     } else {
         // if data was not submitted yet, then use default values
         $note = new object();
index 242eb90b81de6dfa937d5a5c09c9c58f62bb6422..dcd0780cdb41325b7808af07cceba5e11cce4c3e 100644 (file)
@@ -32,7 +32,7 @@ if (!has_capability('moodle/notes:manage', $context)) {
     print_error('You may not delete this note');
 }
 
-if (data_submitted(false) && confirm_sesskey()) {
+if (data_submitted() && confirm_sesskey()) {
 //if data was submitted and is valid, then delete note
     $returnurl = $CFG->wwwroot . '/notes/index.php?course=' . $course->id . '&amp;user=' . $note->userid;
     if (note_delete($noteid)) {
index 65b539c65f7b2dd182d0090f0044e697e6d7be8f..7ebe328e15712e9f215997de30bd4732f477c1d2 100644 (file)
@@ -60,7 +60,7 @@
 
     if ($noteform->is_submitted()) {
         // if data was submitted with errors, then use it as default for new form
-        $note = $noteform->get_submitted_data(false);
+        $note = $noteform->get_submitted_data();
     } else {
         // if data was not submitted yet, then used values retrieved from the database
         $note->user   = $note->userid;
index 26f1b631a6cf85e22ef194bed84e1254c623e0d6..9f3cd03ba260b130335a9c145e79d6131ddf013b 100644 (file)
@@ -428,7 +428,7 @@ class question_category_object {
                                           WHERE c2.id = ?
                                             AND c1.contextid = c2.contextid", array($updateid))){
             // If the question name has changed, rename any random questions in that category.
-            if (addslashes($oldcat->name) != $cat->name) {
+            if ($oldcat->name != $cat->name) {
                 $randomqname = $QTYPES[RANDOM]->question_name($cat);
                 $DB->set_field('question', 'name', $randomqname, array('category' => $cat->id), 'qtype', RANDOM);
                 // Ignore errors here. It is not a big deal if the questions are not renamed.
index 6e44071b48bddfa51bfaa17951f5bc15d378113f..904efe397bdbeb0fb60922697754760b2eed54be 100644 (file)
@@ -10,7 +10,7 @@
     </td>
     <td>
       <?php
-        print_textarea($usehtmleditor, 15, 60, 630, 300, $prefix.'[comment]', stripslashes($state->manualcomment));
+        print_textarea($usehtmleditor, 15, 60, 630, 300, $prefix.'[comment]', $state->manualcomment);
       ?>
     </td>
   </tr>
index 1553521081d5998318bcc4275fa57bae1f0231ff..a9f1bc5593b84c0bb36ef7c8e03cf2d65b589781 100644 (file)
@@ -784,7 +784,7 @@ class qformat_default {
         } else {
             $format = $question->questiontextformat;
         }
-        return format_text(stripslashes($question->questiontext), $format, $formatoptions);
+        return format_text($question->questiontext, $format, $formatoptions);
     }
 
 
index 1d53d6b0f7b36e8a25eb52cb089ba24cc535bddf..135a451207af70aa5753b35e991387713aa76590 100644 (file)
@@ -37,7 +37,7 @@ class qformat_aiken extends qformat_default {
             $newlines = explode($endchar,$line);
             $foundQ = 0;
             for ($i=0; $i < count($newlines);$i++){
-                $nowline = addslashes($newlines[$i]);
+                $nowline = $newlines[$i];
                 ///Go through the array and build an object called $question
                 ///When done, add $question to $questions
                 if (strlen($nowline)< 2) {
@@ -66,7 +66,7 @@ class qformat_aiken extends qformat_default {
                 } else {
                     //Must be the first line since no leader
                     $question->qtype = MULTICHOICE;
-                    $question->name = addslashes( substr($nowline,0,50) );
+                    $question->name = substr($nowline,0,50);
                     $question->questiontext = $nowline;
                     $question->single = 1;
                     $question->feedback[] = "";
index c8e1330cfe1477023cffbacb8dc617b2251b2843..07f8d8be87ad717b54f55f8cdd973fd3bb503d19 100644 (file)
@@ -104,7 +104,7 @@ function process_tf($xml, &$questions) {
         if ($ishtml) {
             $question->questiontext = html_entity_decode_php4(trim($thisquestion["#"]["BODY"][0]["#"]["TEXT"][0]["#"]));
         }
-        $question->questiontext = addslashes($question->questiontext);
+        $question->questiontext = $question->questiontext;
         // put name in question object
         $question->name = substr($question->questiontext, 0, 254);
 
@@ -117,12 +117,12 @@ function process_tf($xml, &$questions) {
 
         if (strcmp($id, $correct_answer) == 0) {  // true is correct
             $question->answer = 1;
-            $question->feedbacktrue = addslashes(trim(@$thisquestion["#"]["GRADABLE"][0]["#"]["FEEDBACK_WHEN_CORRECT"][0]["#"]));
-            $question->feedbackfalse = addslashes(trim(@$thisquestion["#"]["GRADABLE"][0]["#"]["FEEDBACK_WHEN_INCORRECT"][0]["#"]));
+            $question->feedbacktrue = trim(@$thisquestion["#"]["GRADABLE"][0]["#"]["FEEDBACK_WHEN_CORRECT"][0]["#"]);
+            $question->feedbackfalse = trim(@$thisquestion["#"]["GRADABLE"][0]["#"]["FEEDBACK_WHEN_INCORRECT"][0]["#"]);
         } else {  // false is correct
             $question->answer = 0;
-            $question->feedbacktrue = addslashes(trim(@$thisquestion["#"]["GRADABLE"][0]["#"]["FEEDBACK_WHEN_INCORRECT"][0]["#"]));
-            $question->feedbackfalse = addslashes(trim(@$thisquestion["#"]["GRADABLE"][0]["#"]["FEEDBACK_WHEN_CORRECT"][0]["#"]));
+            $question->feedbacktrue = trim(@$thisquestion["#"]["GRADABLE"][0]["#"]["FEEDBACK_WHEN_INCORRECT"][0]["#"]);
+            $question->feedbackfalse = trim(@$thisquestion["#"]["GRADABLE"][0]["#"]["FEEDBACK_WHEN_CORRECT"][0]["#"]);
         }
         $question->correctanswer = $question->answer;
         $questions[] = $question;
@@ -157,7 +157,7 @@ function process_mc($xml, &$questions) {
         if ($ishtml) {
             $question->questiontext = html_entity_decode_php4(trim($thisquestion["#"]["BODY"][0]["#"]["TEXT"][0]["#"]));
         }
-        $question->questiontext = addslashes($question->questiontext);
+        $question->questiontext = $question->questiontext;
 
         // put name of question in question object, careful of length
         $question->name = substr($question->questiontext, 0, 254);
@@ -170,7 +170,7 @@ function process_mc($xml, &$questions) {
             if ($ishtml) {
                 $question->answer[$j] = html_entity_decode_php4($choice);
             }
-            $question->answer[$j] = addslashes($question->answer[$j]);
+            $question->answer[$j] = $question->answer[$j];
 
             $id = $choices[$j]["@"]["id"];
             $correct_answer_id = $thisquestion["#"]["GRADABLE"][0]["#"]["CORRECTANSWER"][0]["@"]["answer_id"];
@@ -180,13 +180,13 @@ function process_mc($xml, &$questions) {
                 if ($ishtml) {
                     $question->feedback[$j] = html_entity_decode_php4(trim(@$thisquestion["#"]["GRADABLE"][0]["#"]["FEEDBACK_WHEN_CORRECT"][0]["#"]));
                 }
-                $question->feedback[$j] = addslashes($question->feedback[$j]);
+                $question->feedback[$j] = $question->feedback[$j];
             } else {
                 $question->fraction[$j] = 0;
                 if ($ishtml) {
                     $question->feedback[$j] = html_entity_decode_php4(trim(@$thisquestion["#"]["GRADABLE"][0]["#"]["FEEDBACK_WHEN_INCORRECT"][0]["#"]));
                 }
-                $question->feedback[$j] = addslashes($question->feedback[$j]);
+                $question->feedback[$j] = $question->feedback[$j];
             }
         }
         $questions[] = $question;
@@ -223,7 +223,7 @@ function process_ma($xml, &$questions) {
         if ($ishtml) {
             $question->questiontext = html_entity_decode_php4(trim($thisquestion["#"]["BODY"][0]["#"]["TEXT"][0]["#"]));
         }
-        $question->questiontext = addslashes($question->questiontext);
+        $question->questiontext = $question->questiontext;
         // put name of question in question object
         $question->name = substr($question->questiontext, 0, 254);
 
@@ -234,7 +234,7 @@ function process_ma($xml, &$questions) {
 
             $choice = trim($choices[$j]["#"]["TEXT"][0]["#"]);
             // put this choice in the question object.
-            $question->answer[$j] = addslashes($choice);
+            $question->answer[$j] = $choice;
 
             $correctanswercount = sizeof($correctanswers);
             $id = $choices[$j]["@"]["id"];
@@ -249,10 +249,10 @@ function process_ma($xml, &$questions) {
             }
             if ($iscorrect) { 
                 $question->fraction[$j] = floor(100000/$correctanswercount)/100000; // strange behavior if we have more than 5 decimal places
-                $question->feedback[$j] = addslashes(trim($thisquestion["#"]["GRADABLE"][$j]["#"]["FEEDBACK_WHEN_CORRECT"][0]["#"]));
+                $question->feedback[$j] = trim($thisquestion["#"]["GRADABLE"][$j]["#"]["FEEDBACK_WHEN_CORRECT"][0]["#"]);
             } else {
                 $question->fraction[$j] = 0;
-                $question->feedback[$j] = addslashes(trim($thisquestion["#"]["GRADABLE"][$j]["#"]["FEEDBACK_WHEN_INCORRECT"][0]["#"]));
+                $question->feedback[$j] = trim($thisquestion["#"]["GRADABLE"][$j]["#"]["FEEDBACK_WHEN_INCORRECT"][0]["#"]);
             }
         }
 
@@ -287,24 +287,24 @@ function process_fib($xml, &$questions) {
         if ($ishtml) {
             $question->questiontext = html_entity_decode_php4(trim($thisquestion["#"]["BODY"][0]["#"]["TEXT"][0]["#"]));
         }
-        $question->questiontext = addslashes($question->questiontext);
+        $question->questiontext = $question->questiontext;
         // put name of question in question object
         $question->name = substr($question->questiontext, 0, 254);
 
         $answer = trim($thisquestion["#"]["ANSWER"][0]["#"]["TEXT"][0]["#"]);
 
-        $question->answer[] = addslashes($answer);
+        $question->answer[] = $answer;
         $question->fraction[] = 1;
         $question->feedback = array();
 
         if (is_array( $thisquestion['#']['GRADABLE'][0]['#'] )) {
-            $question->feedback[0] = addslashes(trim($thisquestion["#"]["GRADABLE"][0]["#"]["FEEDBACK_WHEN_CORRECT"][0]["#"]));
+            $question->feedback[0] = trim($thisquestion["#"]["GRADABLE"][0]["#"]["FEEDBACK_WHEN_CORRECT"][0]["#"]);
         }
         else {
             $question->feedback[0] = '';
         }      
         if (is_array( $thisquestion["#"]["GRADABLE"][0]["#"] )) {
-            $question->feedback[1] = addslashes(trim($thisquestion["#"]["GRADABLE"][0]["#"]["FEEDBACK_WHEN_INCORRECT"][0]["#"]));
+            $question->feedback[1] = trim($thisquestion["#"]["GRADABLE"][0]["#"]["FEEDBACK_WHEN_INCORRECT"][0]["#"]);
         }
         else {
             $question->feedback[1] = '';
@@ -341,7 +341,7 @@ function process_matching($xml, &$questions) {
         if ($ishtml) {
             $question->questiontext = html_entity_decode_php4(trim($thisquestion["#"]["BODY"][0]["#"]["TEXT"][0]["#"]));
         }
-        $question->questiontext = addslashes($question->questiontext);
+        $question->questiontext = $question->questiontext;
         // put name of question in question object
         $question->name = substr($question->questiontext, 0, 254);
 
@@ -353,7 +353,7 @@ function process_matching($xml, &$questions) {
             $choice = $choices[$j]["#"]["TEXT"][0]["#"];
             $choice_id = $choices[$j]["@"]["id"];
           
-            $question->subanswers[] = addslashes(trim($choice));
+            $question->subanswers[] = trim($choice);
  
             $correctanswers = $thisquestion["#"]["GRADABLE"][0]["#"]["CORRECTANSWER"];
             for ($k = 0; $k < sizeof ($correctanswers); $k++) {
@@ -370,7 +370,7 @@ function process_matching($xml, &$questions) {
                         if (strcmp ($current_ans_id, $answer_id) == 0) {
 
                             $answer = $answer["#"]["TEXT"][0]["#"];
-                            $question->subquestions[] = addslashes(trim($answer));
+                            $question->subquestions[] = trim($answer);
                             break;
 
                         }
index 96c6146dff012b839be57d3904a6d8553971dca4..62a16cc35e050b470cfd29a1f1c61b042762e549 100644 (file)
@@ -544,7 +544,7 @@ function process_feedback($feedbackset, &$feedbacks) {
  */
 function process_common( $quest ) {
     $question = $this->defaultquestion();
-    $question->questiontext = addslashes($quest->QUESTION_BLOCK->text);
+    $question->questiontext = $quest->QUESTION_BLOCK->text;
     $question->name = shorten_text( $quest->id, 250 );
 
     return $question;
@@ -574,12 +574,12 @@ function process_tf($quest, &$questions) {
     
     if ($correct) {  // true is correct
         $question->answer = 1;
-        $question->feedbacktrue = addslashes($fback->correct);
-        $question->feedbackfalse = addslashes($fback->incorrect);
+        $question->feedbacktrue = $fback->correct;
+        $question->feedbackfalse = $fback->incorrect;
     } else {  // false is correct
         $question->answer = 0;
-        $question->feedbacktrue = addslashes($fback->incorrect);
-        $question->feedbackfalse = addslashes($fback->correct);
+        $question->feedbacktrue = $fback->incorrect;
+        $question->feedbackfalse = $fback->correct;
     }
     $question->correctanswer = $question->answer;
     $questions[] = $question;
@@ -613,10 +613,10 @@ function process_fblank($quest, &$questions) {
             if (isset($response->ident[0]['varequal'][0]['#'])) {
                 //for BB Fill in the Blank, only interested in correct answers
                 if ($response->feedback = 'correct') {
-                    $answers[] = addslashes($response->ident[0]['varequal'][0]['#']);
+                    $answers[] = $response->ident[0]['varequal'][0]['#'];
                     $fractions[] = 1;
                     if (isset($feedback['correct'])) {
-                        $feedbacks[] = addslashes($feedback['correct']);
+                        $feedbacks[] = $feedback['correct'];
                     }
                     else {
                         $feedbacks[] = '';
@@ -632,7 +632,7 @@ function process_fblank($quest, &$questions) {
     $answers[] = '*';
     $fractions[] = 0;
     if (isset($feedback['incorrect'])) {
-        $feedbacks[] = addslashes($feedback['incorrect']);
+        $feedbacks[] = $feedback['incorrect'];
     }
     else {
         $feedbacks[] = '';
@@ -658,7 +658,7 @@ function process_mc($quest, &$questions) {
     
     $feedback = array();
     foreach($quest->feedback as $fback) {
-        $feedback[$fback->ident] = addslashes($fback->text);
+        $feedback[$fback->ident] = $fback->text;
     }
  
     foreach($quest->responses as $response) {
@@ -679,7 +679,7 @@ function process_mc($quest, &$questions) {
 
     $i = 0;
     foreach($quest->RESPONSE_BLOCK->choices as $response) {
-        $question->answer[$i] = addslashes($response->text);
+        $question->answer[$i] = $response->text;
         if ($correct == $response->ident) {
             $question->fraction[$i] = 1;
             // this is a bit of a hack to catch the feedback... first we see if a 'correct' feedback exists
@@ -737,14 +737,14 @@ function process_ma($quest, &$questions) {
     }
     
     foreach ($quest->feedback as $fb) {
-        $feedback->{$fb->ident} = addslashes(trim($fb->text));
+        $feedback->{$fb->ident} = trim($fb->text);
     }
     
     $correct_answer_count = count($correct_answers);
     $choiceset = $quest->RESPONSE_BLOCK->choices;
     $i = 0;
     foreach($choiceset as $choice) {
-        $question->answer[$i] = addslashes(trim($choice->text));
+        $question->answer[$i] = trim($choice->text);
         if (in_array($choice->ident, $correct_answers)) {
             // correct answer
             $question->fraction[$i] = floor(100000/$correct_answer_count)/100000; // strange behavior if we have more than 5 decimal places
@@ -778,7 +778,7 @@ function process_essay($quest, &$questions) {
             // Added this code to put the possible solution that the
             // instructor gives as the Moodle answer for an essay question
             if ($feedback->ident == 'solution') {
-                $question->feedback = addslashes($feedback->text);
+                $question->feedback = $feedback->text;
             }
         }
         //Added because essay/questiontype.php:save_question_option is expecting a 
@@ -809,15 +809,15 @@ function process_matching($quest, &$questions) {
         foreach($quest->RESPONSE_BLOCK->subquestions as $qid => $subq) {
             foreach($quest->responses as $rid => $resp) {
                 if ($resp->ident == $subq->ident) {
-                    $correct = addslashes($resp->correct);
-                    $feedback = addslashes($resp->feedback);   
+                    $correct = $resp->correct;
+                    $feedback = $resp->feedback;   
                 }
             }
         
             foreach($subq->choices as $cid => $choice) {
                 if ($choice == $correct) {
-                    $question->subquestions[] = addslashes($subq->text);
-                    $question->subanswers[] = addslashes($quest->RIGHT_MATCH_BLOCK->matching_answerset[$cid]->text);
+                    $question->subquestions[] = $subq->text;
+                    $question->subanswers[] = $quest->RIGHT_MATCH_BLOCK->matching_answerset[$cid]->text;
                 }
             }
         }
index 0f8cb172bd3a99521cb2d1b2e464fd8a2aec017b..ba34992fb22e34207f01b91831fddcf4f3b5edc7 100755 (executable)
@@ -67,18 +67,18 @@ class qformat_coursetestmanager extends qformat_default {
 
             echo "<tr><td align=\"right\">";
             echo "What is the hostname or IP address of the ODBC Socket Server:</td><td>";
-            echo " <input name=\"hostname\" type=\"text\" size=\"50\" value=\"".stripslashes($hostname_access_error)."\" />";
+            echo " <input name=\"hostname\" type=\"text\" size=\"50\" value=\"".$hostname_access_error."\" />";
             echo " <input name=\"filename\" type=\"hidden\" value=\"".$filename."\" />";
             echo " <input name=\"category\" type=\"hidden\" value=\"".$category->id."\" />";
             echo " <input name=\"format\" type=\"hidden\" value=\"".$form->format."\" />";
             echo "</td><td>&nbsp;</td></tr>";
             echo "<tr><td align=\"right\">";
             echo "What is the location of the database (.mdb file) on the Socket Server:</td><td>";
-            echo " <input name=\"mdbpath\" type=\"text\" size=\"50\" value=\"".stripslashes($mdbpath)."\" />";
+            echo " <input name=\"mdbpath\" type=\"text\" size=\"50\" value=\"".$mdbpath."\" />";
             echo "</td><td>&nbsp;</td></tr>";
             echo "<tr><td align=\"right\">";
             echo "What is the location of the system database (System.mda file) on the Socket Server:</td><td>";
-            echo " <input name=\"mdapath\" type=\"text\" size=\"50\" value=\"".stripslashes($mdapath)."\" />";
+            echo " <input name=\"mdapath\" type=\"text\" size=\"50\" value=\"".$mdapath."\" />";
             echo "</td><td>&nbsp;</td></tr>";
             echo "<tr><td>&nbsp;</td><td>";
             echo " <input type=\"submit\" name=\"save\" value=\"Connect to Server\" />";
@@ -138,9 +138,9 @@ class qformat_coursetestmanager extends qformat_default {
             echo " <input name=\"category\" type=\"hidden\" value=\"".$category->id."\" />";
             echo " <input name=\"format\" type=\"hidden\" value=\"".$form->format."\" />";
             if (PHP_OS == "Linux") {
-                echo " <input name=\"hostname\" type=\"hidden\" value=\"".stripslashes(trim($hostname))."\" />";
-                echo " <input name=\"mdbpath\" type=\"hidden\" value=\"".stripslashes($mdbpath)."\" />";
-                echo " <input name=\"mdapath\" type=\"hidden\" value=\"".stripslashes($mdapath)."\" />";
+                echo " <input name=\"hostname\" type=\"hidden\" value=\"".trim($hostname)."\" />";
+                echo " <input name=\"mdbpath\" type=\"hidden\" value=\"".$mdbpath."\" />";
+                echo " <input name=\"mdapath\" type=\"hidden\" value=\"".$mdapath."\" />";
             }
             echo "</td><td>&nbsp;</td>";
             echo "</tr><tr><td>&nbsp;</td><td>";
@@ -186,14 +186,14 @@ class qformat_coursetestmanager extends qformat_default {
                 case 1:
                     $question->qtype = MULTICHOICE; // MULTICHOICE, SHORTANSWER, TRUEFALSE
         //          echo "<pre>";echo htmlspecialchars($qrec[2]); echo "</pre>";
-                    $question->questiontext = addslashes(trim($qrec[2]));
+                    $question->questiontext = trim($qrec[2]);
         //          echo "<pre>";echo $question->questiontext; echo "</pre>";
                     $question->name = preg_replace("/<br />/", "", $question->questiontext);
                     $question->single = 1;  // Only one answer is allowed -- used for multiple choicers
                     $fractionset = 0;
                     for ($i=4;$i<=7;$i++) {
                         if ($qrec[$i] != "") {
-                            $question->answer[$i-3]=addslashes($qrec[$i]);
+                            $question->answer[$i-3]=$qrec[$i];
                             if ($qrec[8] == $i-3) {  // if this is the index of CorrectAnswer
                                 $question->fraction[$i-3] = 1;
                                 $fractionset = 1;
@@ -209,7 +209,7 @@ class qformat_coursetestmanager extends qformat_default {
                 break;
                 case 2:  // TRUE FALSE
                     $question->qtype = TRUEFALSE;
-                    $question->questiontext = addslashes(trim($qrec[2]));
+                    $question->questiontext = trim($qrec[2]);
                     $question->name = preg_replace("/<br />/", "", $question->questiontext);
                     // for TF, $question->answer should be 1 for true, 0 for false
                     if ($qrec[8] == "T") {
@@ -223,7 +223,7 @@ class qformat_coursetestmanager extends qformat_default {
                 break;
                 case 3:
                     $question->qtype = SHORTANSWER;
-                    $question->questiontext = addslashes(trim($qrec[2]));
+                    $question->questiontext = trim($qrec[2]);
         //          echo "<pre>";echo $question->questiontext; echo "</pre>";
                     $question->name = preg_replace("/<br />/", "", $question->questiontext);
                     $question->usecase=0;  // Ignore case -- for SHORT ANSWER questions
@@ -231,7 +231,7 @@ class qformat_coursetestmanager extends qformat_default {
                     $question->answer[0]=" ";
                     $question->fraction[0]=1;
                     for ($i=0;$i<count($answers);$i++) {
-                        $question->answer[$i] = addslashes(trim($answers[$i]));
+                        $question->answer[$i] = trim($answers[$i]);
                         $question->feedback[$i] = $ref;
                         $question->fraction[$i] = 1; // 1 for 100%, 0 for none or somewhere in between
                     }
@@ -257,7 +257,7 @@ class qformat_coursetestmanager extends qformat_default {
         }
         foreach ($questions as $question) {   // Process and store each question
             $count++;
-            echo "<hr /><p><b>$count</b>. ".stripslashes($question->questiontext)."</p>";
+            echo "<hr /><p><b>$count</b>. ".$question->questiontext."</p>";
             $question->category = $this->category->id;
             $question->stamp = make_unique_id_code();  // Set the unique code (not to be changed)
             $question->createdby = $USER->id;
index 99df6087ca1056d2ed3c16b28e1e8eac356066fa..3448d79574b028308b25eddab581915a930de787 100755 (executable)
@@ -40,7 +40,7 @@ class qformat_examview extends qformat_default {
     function unxmlise( $xml ) {
         // if it's not an array then it's probably just data
         if (!is_array($xml)) {
-            $text = s(addslashes($xml));
+            $text = s($xml);
         }
         else {
             // otherwise parse the array
@@ -101,17 +101,17 @@ class qformat_examview extends qformat_default {
         }
         foreach($this->matching_questions as $match_group) {
             $question = $this->defaultquestion();
-            $htmltext = s(addslashes($match_group->questiontext));
+            $htmltext = s($match_group->questiontext);
             $question->questiontext = $htmltext;
             $question->name = $question->questiontext;
             $question->qtype = MATCH;
             $question->subquestions = array();
             $question->subanswers = array();
             foreach($match_group->subquestions as $key => $value) {
-                $htmltext = s(addslashes($value));
+                $htmltext = s($value);
                 $question->subquestions[] = $htmltext;
 
-                $htmltext = s(addslashes($match_group->subanswers[$key]));
+                $htmltext = s($match_group->subanswers[$key]);
                 $question->subanswers[] = $htmltext;
             }
             $questions[] = $question;
@@ -245,7 +245,7 @@ class qformat_examview extends qformat_default {
         foreach($answers as $key => $value) {
             $value = trim($value);
             if (strlen($value) > 0) {
-                $question->answer[$key] = addslashes($value);
+                $question->answer[$key] = $value;
                 $question->fraction[$key] = 1;
                 $question->feedback[$key] = "Correct";
             }
index 506efa507656729a028c2f343d2a0161b6d0e785..43c8d7d544f5c998cf4e434246107d4ded178b66 100755 (executable)
@@ -59,7 +59,7 @@ class qformat_gift extends qformat_default {
         if (strpos($answer,"#") > 0){
             $hashpos = strpos($answer,"#");
             $comment = substr($answer, $hashpos+1);
-            $comment = addslashes(trim($this->escapedchar_post($comment)));
+            $comment = trim($this->escapedchar_post($comment));
             $answer  = substr($answer, 0, $hashpos);
         } else {
             $comment = " ";
@@ -159,7 +159,7 @@ class qformat_gift extends qformat_default {
                 // name will be assigned after processing question text below
             } else {
                 $questionname = substr($text, 0, $namefinish);
-                $question->name = addslashes(trim($this->escapedchar_post($questionname)));
+                $question->name = trim($this->escapedchar_post($questionname));
                 $text = trim(substr($text, $namefinish+2)); // Remove name from text
             }
         } else {
@@ -212,7 +212,7 @@ class qformat_gift extends qformat_default {
             }          
         }
         $question->questiontextformat = $questiontextformat;
-        $question->questiontext = addslashes(trim($this->escapedchar_post($questiontext)));
+        $question->questiontext = trim($this->escapedchar_post($questiontext));
 
         // set question name if not already set
         if ($question->name === false) {
@@ -325,7 +325,7 @@ class qformat_gift extends qformat_default {
                     }
                     $question->fraction[$key] = $answer_weight;
                     $question->feedback[$key] = $this->commentparser($answer); // commentparser also removes comment from $answer
-                    $question->answer[$key]   = addslashes($this->escapedchar_post($answer));
+                    $question->answer[$key]   = $this->escapedchar_post($answer);
                     $question->correctfeedback = '';
                     $question->partiallycorrectfeedback = '';
                     $question->incorrectfeedback = '';
@@ -360,8 +360,8 @@ class qformat_gift extends qformat_default {
                     }
 
                     $marker = strpos($answer,"->");
-                    $question->subquestions[$key] = addslashes(trim($this->escapedchar_post(substr($answer, 0, $marker))));
-                    $question->subanswers[$key]   = addslashes(trim($this->escapedchar_post(substr($answer, $marker+2))));
+                    $question->subquestions[$key] = trim($this->escapedchar_post(substr($answer, 0, $marker)));
+                    $question->subanswers[$key]   = trim($this->escapedchar_post(substr($answer, $marker+2)));
 
                 }  // end foreach answer
     
@@ -415,7 +415,7 @@ class qformat_gift extends qformat_default {
                     }
                     $question->fraction[$key] = $answer_weight;
                     $question->feedback[$key] = $this->commentparser($answer); //commentparser also removes comment from $answer
-                    $question->answer[$key]   = addslashes($this->escapedchar_post($answer));
+                    $question->answer[$key]   = $this->escapedchar_post($answer);
                 }     // end foreach
 
                 //$question->usecase = 0;  // Ignore case
index 5145a26bc90af60877ae3d6eef0c0f01f8cda14f..3ae0dc90f70608c0c8d294859deeb88463c344df 100644 (file)
@@ -494,7 +494,7 @@ class qformat_hotpot extends qformat_default {
         // convert html entities to unicode and add slashes
         $str = preg_replace('/&#x([0-9a-f]+);/ie', "hotpot_charcode_to_utf8(hexdec('\\1'))", $str);
         $str = preg_replace('/&#([0-9]+);/e', "hotpot_charcode_to_utf8(\\1)", $str);
-        return addslashes($str);
+        return $str;
     }
 } // end class
 
index 0f1e9523afaae25f87cb6e0a7c071d7ee75e53c2..ec3666481a02085fcc31b1396b40c358f28801d4 100644 (file)
@@ -67,7 +67,7 @@ class qformat_missingword extends qformat_default {
         $answertext = substr($text, $answerstart + 1, $answerlength - 1);
 
         /// Save the new question text
-        $question->questiontext = addslashes(substr_replace($text, "_____", $answerstart, $answerlength+1));
+        $question->questiontext = substr_replace($text, "_____", $answerstart, $answerlength+1);
         $question->name = $question->questiontext;
 
 
@@ -97,7 +97,7 @@ class qformat_missingword extends qformat_default {
                 if ($answer[0] == "=") {
                     $answer = substr($answer, 1);
                 }
-                $question->answer[]   = addslashes($answer);
+                $question->answer[]   = $answer;
                 $question->fraction[] = 1;
                 $question->feedback[] = "";
     
@@ -130,7 +130,7 @@ class qformat_missingword extends qformat_default {
 
                     if (strpos($answer,"#") > 0){
                         $hashpos = strpos($answer,"#");
-                        $comment = addslashes(substr(($answer),$hashpos+1));
+                        $comment = substr(($answer),$hashpos+1);
                         $answer  = substr($answer,0,$hashpos);
                     } else {
                         $comment = " ";
@@ -145,7 +145,7 @@ class qformat_missingword extends qformat_default {
 #                       $question->fraction[$key] = 0;
                         $question->fraction[$key] = $answeight;
                     }
-                    $question->answer[$key]   = addslashes($answer);
+                    $question->answer[$key]   = $answer;
                     $question->feedback[$key] = $comment;
                 }
     
index 01b0ec8e2c1f829ee2e83002d51a52fd53a8a970..ce42e6321b0e25bc6158914cf64d9e683b643be2 100644 (file)
@@ -26,12 +26,12 @@ class qformat_multianswer extends qformat_default {
 
         $questions= array();
         $thequestion= qtype_multianswer_extract_question(
-                addslashes(implode('',$lines)));
+                implode('',$lines));
         $thequestion->qtype = MULTIANSWER;
         $thequestion->course = $this->course;
 
         if (!empty($thequestion)) {
-            $thequestion->name = addslashes($lines[0]);
+            $thequestion->name = $lines[0];
             
             $questions[] = $thequestion;
         }
index 7e3660ae0b84e0a2a9f949ebf8715a3e637ff28f..4e897bb65215faacfd451930e42c5acd1c3fae9a 100644 (file)
@@ -289,7 +289,7 @@ function handle_questions_media(&$questions, $path, $courseid) {
 
             // results are first written into string (and then to a file)
             $count++;
-            echo "<hr /><p><b>$count</b>. ".stripslashes($question->questiontext)."</p>";
+            echo "<hr /><p><b>$count</b>. ".$question->questiontext."</p>";
             $expout = $this->writequestion( $question , null, true, $path) . "\n";
             $expout = $this->presave_process( $expout );
 
index 8c82cce178fa8a23096982cfaad04d0023003c2c..f97b488044a980c6a9231d41cc05771d3614e226 100644 (file)
@@ -191,7 +191,7 @@ class qformat_webct extends qformat_default {
 
             if (isset($questiontext) and is_string($questiontext)) {
                 if (ereg("^:",$line)) {
-                    $question->questiontext = addslashes(trim($questiontext));
+                    $question->questiontext = trim($questiontext);
                     unset($questiontext);
                 }
                  else {
@@ -202,7 +202,7 @@ class qformat_webct extends qformat_default {
 
             if (isset($answertext) and is_string($answertext)) {
                 if (ereg("^:",$line)) {
-                    $answertext = addslashes(trim($answertext));
+                    $answertext = trim($answertext);
                     $question->answer[$currentchoice] = $answertext;
                     $question->subanswers[$currentchoice] = $answertext;
                     unset($answertext);
@@ -215,7 +215,7 @@ class qformat_webct extends qformat_default {
 
             if (isset($responsetext) and is_string($responsetext)) {
                 if (ereg("^:",$line)) {
-                    $question->subquestions[$currentchoice] = addslashes(trim($responsetext));
+                    $question->subquestions[$currentchoice] = trim($responsetext);
                     unset($responsetext);
                 }
                  else {
@@ -226,7 +226,7 @@ class qformat_webct extends qformat_default {
 
             if (isset($feedbacktext) and is_string($feedbacktext)) {
                 if (ereg("^:",$line)) {
-                   $question->feedback[$currentchoice] = addslashes(trim($feedbacktext));
+                   $question->feedback[$currentchoice] = trim($feedbacktext);
                     unset($feedbacktext);
                 }
                  else {
@@ -237,7 +237,7 @@ class qformat_webct extends qformat_default {
 
             if (isset($generalfeedbacktext) and is_string($generalfeedbacktext)) {
                 if (ereg("^:",$line)) {
-                   $question->tempgeneralfeedback= addslashes(trim($generalfeedbacktext));
+                   $question->tempgeneralfeedback= trim($generalfeedbacktext);
                     unset($generalfeedbacktext);
                 }
                  else {
@@ -469,7 +469,7 @@ class qformat_webct extends qformat_default {
                     $name = substr($name,0,250)."...";
                     $warnings[] = get_string("questionnametoolong", "quiz", $nLineCounter);
                 }
-                $question->name = addslashes($name);
+                $question->name = $name;
                 continue;
             }
 
index 62da62affa6ea9c25928905e4d8f7497648ab434..352fe5ab27e082df15e96c6b3fc432f6290788e4 100755 (executable)
@@ -79,7 +79,7 @@ class qformat_xml extends qformat_default {
             return '';
         }
         $data = $text[0]['#'];
-        return addslashes(trim( $data ));
+        return trim($data);
     }
 
     /**
@@ -108,7 +108,7 @@ class qformat_xml extends qformat_default {
             if (!is_string($xml)) {
                 $this->error( 'Invalid xml file - string expected (use CDATA?)' );
             }
-            $xml = addslashes( trim( $xml ) );
+            $xml = trim( $xml );
         }
 
         return $xml;
@@ -135,7 +135,7 @@ class qformat_xml extends qformat_default {
         $image = $this->getpath( $question, array('#','image',0,'#'), $qo->image );
         $image_base64 = $this->getpath( $question, array('#','image_base64','0','#'),'' );
         if (!empty($image_base64)) {
-            $qo->image = $this->importimagefile( $image, stripslashes($image_base64) );
+            $qo->image = $this->importimagefile( $image, $image_base64);
         }
         $qo->generalfeedback = $this->getpath( $question, array('#','generalfeedback',0,'#','text',0,'#'), $qo->generalfeedback, true );
         $qo->defaultgrade = $this->getpath( $question, array('#','defaultgrade',0,'#'), $qo->defaultgrade );
@@ -755,7 +755,7 @@ class qformat_xml extends qformat_default {
             return '';
         }
 
-        $content = "    <image_base64>\n".addslashes(base64_encode( $binary ))."\n".
+        $content = "    <image_base64>\n".base64_encode( $binary )."\n".
             "\n    </image_base64>\n";
         return $content;
     }
@@ -922,7 +922,7 @@ class qformat_xml extends qformat_default {
         case MULTIANSWER:
             $a_count=1;
             foreach($question->options->questions as $question) {
-                $thispattern = addslashes("{#".$a_count."}");
+                $thispattern = addslashes("{#".$a_count."}"); // TODO: fix this addslashes
                 $thisreplace = $question->questiontext;
                 $expout=ereg_replace($thispattern, $thisreplace, $expout );
                 $a_count++;
index d96dddda2b25b403fc7340b5b42985abcc0c4f6f..f3ea4d5d12265e0f67e8f3a0d32a65c2248bcc94 100644 (file)
@@ -84,7 +84,7 @@ class question_essay_qtype extends default_questiontype {
 
         // get response value
         if (isset($state->responses[''])) {
-            $value = stripslashes_safe($state->responses['']);
+            $value = $state->responses[''];
         } else {
             $value = "";
         }
index 051a7b9184f8229db47946577d302cc58058681a..76757e9ca62ff00a0ef2f744f450e2977b553800 100644 (file)
@@ -649,7 +649,7 @@ class question_match_qtype extends default_questiontype {
             foreach ($subquestions as $subquestion) {
                 $questiontext = restore_decode_content_links_worker($subquestion->questiontext, $restore);
                 if ($questiontext != $subquestion->questiontext) {
-                    $subquestion->questiontext = addslashes($questiontext);
+                    $subquestion->questiontext = $questiontext;
                     if (!$DB->update_record('question_match_sub', $subquestion)) {
                         $status = false;
                     }
index a7dfafb89c7d59fc99e59acd3a93cd1aab0d6b48..c4104fee70d070a530a51c3b2719bc816c05d6bf 100644 (file)
@@ -575,9 +575,9 @@ class question_multichoice_qtype extends default_questiontype {
                 if ($correctfeedback != $multichoice->correctfeedback ||
                         $partiallycorrectfeedback != $multichoice->partiallycorrectfeedback ||
                         $incorrectfeedback != $multichoice->incorrectfeedback) {
-                    $subquestion->correctfeedback = addslashes($correctfeedback);
-                    $subquestion->partiallycorrectfeedback = addslashes($partiallycorrectfeedback);
-                    $subquestion->incorrectfeedback = addslashes($incorrectfeedback);
+                    $subquestion->correctfeedback = $correctfeedback;
+                    $subquestion->partiallycorrectfeedback = $partiallycorrectfeedback;
+                    $subquestion->incorrectfeedback = $incorrectfeedback;
                     if (!$DB->update_record('question_multichoice', $multichoice)) {
                         $status = false;
                     }
index 73e41c09c29ec4e9eef08ae96d08ffd2ba4fd3b9..56a1c066d3e5d122137997374282f2b925439f0d 100644 (file)
@@ -245,7 +245,7 @@ class question_numerical_qtype extends question_shortanswer_qtype {
             return true;
         }
 
-        $response = $this->apply_unit(stripslashes($state->responses['']), $question->options->units);
+        $response = $this->apply_unit($state->responses[''], $question->options->units);
 
         if ($response === false) {
             return false; // The student did not type a number.
index 1269f768d1350c808b415840d0c6bf4a2b4d169e..2c0821271e887fc0ecb44f9bf5393af1fede7216 100644 (file)
@@ -634,7 +634,7 @@ class default_questiontype {
         if ($question->options->answers) {
             foreach ($question->options->answers as $answer) {
                 if (((int) $answer->fraction) === 1) {
-                    return array('' => addslashes($answer->answer));
+                    return array('' => $answer->answer);
                 }
             }
         }
@@ -691,7 +691,7 @@ class default_questiontype {
     // ULPGC ecastro
     function get_actual_response($question, $state) {
        if (!empty($state->responses)) {
-           $responses[] = stripslashes($state->responses['']);
+           $responses[] = $state->responses[''];
        } else {
            $responses[] = '';
        }
@@ -851,7 +851,7 @@ class default_questiontype {
             $grade .= $question->maxgrade;
         }
 
-        $comment = stripslashes($state->manualcomment);
+        $comment = $state->manualcomment;
         $commentlink = '';
 
         if (isset($options->questioncommentlink) && $context && has_capability('mod/quiz:grade', $context)) {
index 830959519b4e28615deeb70fc3dedd78018e251c..d5066688d94076cc7a1c61d946e76e5446b98402 100644 (file)
@@ -206,7 +206,7 @@ class question_shortanswer_qtype extends default_questiontype {
     function test_response(&$question, $state, $answer) {
         // Trim the response before it is saved in the database. See MDL-10709
         $state->responses[''] = trim($state->responses['']);
-        return $this->compare_string_with_wildcard(stripslashes_safe($state->responses['']),
+        return $this->compare_string_with_wildcard($state->responses[''],
                 $answer->answer, !$question->options->usecase);
     }
 
@@ -235,7 +235,7 @@ class question_shortanswer_qtype extends default_questiontype {
     function get_correct_responses(&$question, &$state) {
         $response = parent::get_correct_responses($question, $state);
         if (is_array($response)) {
-            $response[''] = addslashes(str_replace('\*', '*', stripslashes($response[''])));
+            $response[''] = str_replace('\*', '*', $response['']);
         }
         return $response;
     }
index f8fe38cfc1cfca5f96a2be303e5b28e534938894..1afa9206561be3768ef7e58ccfbd5fd203946c19 100644 (file)
@@ -8,7 +8,7 @@
     require_login();
 
     // get the login data 
-    $frm = data_submitted('');
+    $frm = data_submitted();
 
     // log back into Hive
     if (sso_user_login($frm->username, $frm->password)) {  
index 1939f1aab4ded1033d91604846d1ba4e1a40d211..4c2696719e5ba1625c5d9f63481960e6e0267331 100644 (file)
@@ -58,7 +58,7 @@ $tagform->set_data($tag);
 // If new data has been sent, update the tag record
 if ($tagnew = $tagform->get_data()) {
 
-    tag_description_set($tag_id, stripslashes($tagnew->description), $tagnew->descriptionformat);
+    tag_description_set($tag_id, $tagnew->description, $tagnew->descriptionformat);
 
     if (has_capability('moodle/tag:manage', $systemcontext)) {
         if (($tag->tagtype != 'default') && (!isset($tagnew->tagtype) || ($tagnew->tagtype != '1'))) {
index 7eaefb9c454692300a7da97342f4e5115fbe7942..1d5cc7256a3f9eeac6fb221c4cae19b7d806fef9 100644 (file)
@@ -6,10 +6,10 @@ require_once('lib.php');
 require_login();
 
 if (empty($CFG->usetags)) {
-    error(get_string('tagsaredisabled', 'tag'));
+    print_error('tagsaredisabled', 'tag');
 }
 
-$query = addslashes(optional_param('query', '', PARAM_RAW));  
+$query = optional_param('query', '', PARAM_RAW);  
 
 if ($similar_tags = tag_autocomplete($query)) {
     foreach ($similar_tags as $tag) {
index 28c0bda06c4549dd3cd6b1d5dd0e08364be93fbc..0713e86e5e5391e0dd39f12447ee8fdbe3b3efad 100644 (file)
@@ -23,7 +23,7 @@ class ChameleonCSS {
             $this->error = 'couldn\'t open file';
             return false;
         }
-        fwrite($fp, stripslashes($content));
+        fwrite($fp, $content);
         fclose($fp);
         return true;
     }
index f0f3df6663d5a08694db033e7c67ae2dca7e0caf..7844dc80a368584652df9f1d20bce7c4b7781b19 100644 (file)
@@ -89,7 +89,7 @@
     $userform = new user_edit_form();
     $userform->set_data($user);
 
-    if ($usernew = $userform->get_data(false)) {
+    if ($usernew = $userform->get_data()) {
 
         add_to_log($course->id, 'user', 'update', "view.php?id=$user->id&course=$course->id", '');
 
         }
 
         // pass a true $userold here
-        if (! $authplugin->user_update($user, $userform->get_data(false))) {
+        if (! $authplugin->user_update($user, $userform->get_data())) {
             // auth update failed, rollback for moodle
             $DB->update_record('user', $user);
             print_error('Failed to update user data on external auth: '.$user->auth.
index 2fa03183d832af6b13492c35d67b0c2dbe32201a..c40048f4ee8830f61b8fa06787689142ab0581fe 100644 (file)
@@ -68,7 +68,7 @@
     $userform = new user_editadvanced_form();
     $userform->set_data($user);
 
-    if ($usernew = $userform->get_data(false)) {
+    if ($usernew = $userform->get_data()) {
         add_to_log($course->id, 'user', 'update', "view.php?id=$user->id&course=$course->id", '');
 
         if (empty($usernew->auth)) {
@@ -96,7 +96,7 @@
                 print_error('Error updating user record');
             }
             // pass a true $userold here
-            if (! $authplugin->user_update($user, $userform->get_data(false))) {
+            if (! $authplugin->user_update($user, $userform->get_data())) {
                 // auth update failed, rollback for moodle
                 $DB->update_record('user', $user);
                 print_error('Failed to update user data on external auth: '.$user->auth.
index d062b738d735ea4fa714a595d37aaa2b7f364b0c..3893f35f02c4ecb204255ba474f8f71157b84e2f 100644 (file)
@@ -48,7 +48,7 @@ class user_filtering {
 
         // fist the new filter form
         $this->_addform = new user_add_filter_form($baseurl, array('fields'=>$this->_fields, 'extraparams'=>$extraparams));
-        if ($adddata = $this->_addform->get_data(false)) {
+        if ($adddata = $this->_addform->get_data()) {
             foreach($this->_fields as $fname=>$field) {
                 $data = $field->check_data($adddata);
                 if ($data === false) {
@@ -66,7 +66,7 @@ class user_filtering {
 
         // now the active filters
         $this->_activeform = new user_active_filter_form($baseurl, array('fields'=>$this->_fields, 'extraparams'=>$extraparams));
-        if ($adddata = $this->_activeform->get_data(false)) {
+        if ($adddata = $this->_activeform->get_data()) {
             if (!empty($adddata->removeall)) {
                 $SESSION->user_filtering = array();
 
index 492e3bd4092f2b65a60489994c73a1d86aec5d60..256e90cacdd65f95266bf62714195fe2a3ab3851 100644 (file)
@@ -94,7 +94,7 @@
 <input type="hidden" name="id" value="'.$id.'" />
 <input type="hidden" name="format" value="'.$format.'" />
 ';
-                echo "<h3>".get_string('previewhtml')."</h3><div class=\"messagepreview\">\n".format_text(stripslashes($messagebody),$format)."\n</div>\n";
+                echo "<h3>".get_string('previewhtml')."</h3><div class=\"messagepreview\">\n".format_text($messagebody,$format)."\n</div>\n";
                 echo '<p align="center"><input type="submit" name="send" value="'.get_string('sendmessage', 'message').'" />'."\n";
                 echo '<input type="submit" name="edit" value="'.get_string('update').'" /></p>';
                 echo "\n</form>";
                 $good = 1;
                 $teachers = array();
                 foreach ($SESSION->emailto[$id] as $user) {
-                    $good = $good && message_post_message($USER,$user,addslashes($messagebody),$format,'direct');
+                    $good = $good && message_post_message($USER,$user,$messagebody,$format,'direct');
                     if ($user->teacher) {
                         $teachers[] = $user->id;
                     }
index e929401468f3516ba44de7b9f67833890296baa1..7d65d62834eca16783aa6cdced27f37f27056906 100644 (file)
@@ -420,7 +420,7 @@ function profile_edit_category($id, $redirect) {
     if ($categoryform->is_cancelled()) {
         redirect($redirect);
     } else {
-        if ($data = $categoryform->get_data(false)) {
+        if ($data = $categoryform->get_data()) {
             if (empty($data->id)) {
                 unset($data->id);
                 $data->sortorder = $DB->count_records('user_info_category') + 1;