mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
MDL-7749 fixed stripslashes when saving admin configuration values
This commit is contained in:
parent
4649ac8436
commit
56909d267f
3 changed files with 3 additions and 12 deletions
|
@ -18,10 +18,7 @@ $CFG->adminsearchquery = $query; // So we can reference it in search boxes late
|
||||||
$statusmsg = '';
|
$statusmsg = '';
|
||||||
|
|
||||||
if ($data = data_submitted()) {
|
if ($data = data_submitted()) {
|
||||||
$unslashed = array();
|
$unslashed = (array)stripslashes_recursive($data);
|
||||||
foreach($data as $key=>$value) {
|
|
||||||
$unslashed[$key] = stripslashes($value);
|
|
||||||
}
|
|
||||||
if (confirm_sesskey()) {
|
if (confirm_sesskey()) {
|
||||||
$olddbsessions = !empty($CFG->dbsessions);
|
$olddbsessions = !empty($CFG->dbsessions);
|
||||||
$changedsettings = search_settings(admin_get_root(), $query);
|
$changedsettings = search_settings(admin_get_root(), $query);
|
||||||
|
|
|
@ -58,10 +58,7 @@ $statusmsg = '';
|
||||||
if ($data = data_submitted()) {
|
if ($data = data_submitted()) {
|
||||||
if (confirm_sesskey()) {
|
if (confirm_sesskey()) {
|
||||||
$olddbsessions = !empty($CFG->dbsessions);
|
$olddbsessions = !empty($CFG->dbsessions);
|
||||||
$unslashed = array();
|
$unslashed = (array)stripslashes_recursive($data);
|
||||||
foreach($data as $key=>$value) {
|
|
||||||
$unslashed[$key] = stripslashes($value);
|
|
||||||
}
|
|
||||||
$errors = $root->write_settings($unslashed);
|
$errors = $root->write_settings($unslashed);
|
||||||
//force logout if dbsession setting changes
|
//force logout if dbsession setting changes
|
||||||
if ($olddbsessions != !empty($CFG->dbsessions)) {
|
if ($olddbsessions != !empty($CFG->dbsessions)) {
|
||||||
|
|
|
@ -24,10 +24,7 @@ if ($newsettingshtml == '') {
|
||||||
|
|
||||||
// now we'll deal with the case that the admin has submitted the form with new settings
|
// now we'll deal with the case that the admin has submitted the form with new settings
|
||||||
if ($data = data_submitted()) {
|
if ($data = data_submitted()) {
|
||||||
$unslashed = array();
|
$unslashed = (array)stripslashes_recursive($data);
|
||||||
foreach($data as $key=>$value) {
|
|
||||||
$unslashed[$key] = stripslashes($value);
|
|
||||||
}
|
|
||||||
if (confirm_sesskey()) {
|
if (confirm_sesskey()) {
|
||||||
$newsettings = find_new_settings(admin_get_root());
|
$newsettings = find_new_settings(admin_get_root());
|
||||||
$errors = '';
|
$errors = '';
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue