]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-7749 fixed stripslashes when saving admin configuration values
authorskodak <skodak>
Thu, 30 Nov 2006 20:37:14 +0000 (20:37 +0000)
committerskodak <skodak>
Thu, 30 Nov 2006 20:37:14 +0000 (20:37 +0000)
admin/search.php
admin/settings.php
admin/upgradesettings.php

index 1e4590ff1058f6b2b527cdb296ca4865316209e0..f33028ef8cdef9c2debe10538f6f716243c90c81 100644 (file)
@@ -18,10 +18,7 @@ $CFG->adminsearchquery = $query;  // So we can reference it in search boxes late
 $statusmsg = '';
 
 if ($data = data_submitted()) {
-    $unslashed = array();
-    foreach($data as $key=>$value) {
-        $unslashed[$key] = stripslashes($value);
-    }
+    $unslashed = (array)stripslashes_recursive($data);
     if (confirm_sesskey()) {
         $olddbsessions = !empty($CFG->dbsessions);
         $changedsettings = search_settings(admin_get_root(), $query);
index 953dc3b1cf5430a353aedaffddfe3644a07713b3..41d6ce11fec215877e2286feb80544e7709b2f11 100644 (file)
@@ -58,10 +58,7 @@ $statusmsg = '';
 if ($data = data_submitted()) {
     if (confirm_sesskey()) {
         $olddbsessions = !empty($CFG->dbsessions);
-        $unslashed = array();
-        foreach($data as $key=>$value) {
-            $unslashed[$key] = stripslashes($value);
-        }
+        $unslashed = (array)stripslashes_recursive($data);
         $errors = $root->write_settings($unslashed);
         //force logout if dbsession setting changes
         if ($olddbsessions != !empty($CFG->dbsessions)) {
index 70666e6c342073f42942937dc652e0165c88ab31..730747c8fc0f87dc35f227c48b703c0770dd10c4 100644 (file)
@@ -24,10 +24,7 @@ if ($newsettingshtml == '') {
 
 // now we'll deal with the case that the admin has submitted the form with new settings
 if ($data = data_submitted()) {
-    $unslashed = array();
-    foreach($data as $key=>$value) {
-        $unslashed[$key] = stripslashes($value);
-    }
+    $unslashed = (array)stripslashes_recursive($data);
     if (confirm_sesskey()) {
         $newsettings = find_new_settings(admin_get_root());
         $errors = '';