mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
MDL-7722 fixed wrong cleaning in backup paths
This commit is contained in:
parent
16fc208896
commit
348d6827b3
2 changed files with 6 additions and 7 deletions
|
@ -2153,7 +2153,7 @@ class admin_setting_special_backupsaveto extends admin_setting_configtext {
|
|||
$name = 'backup_sche_destination';
|
||||
$visiblename = get_string('saveto');
|
||||
$description = get_string('backupsavetohelp');
|
||||
parent::admin_setting_configtext($name, $visiblename, $description, '', PARAM_PATH);
|
||||
parent::admin_setting_configtext($name, $visiblename, $description, '');
|
||||
}
|
||||
|
||||
function get_setting() {
|
||||
|
@ -2162,10 +2162,8 @@ class admin_setting_special_backupsaveto extends admin_setting_configtext {
|
|||
}
|
||||
|
||||
function write_setting($data) {
|
||||
$data = clean_param($data, PARAM_PATH);
|
||||
if (!empty($data) and (substr($data,-1) == '/' or substr($data,-1) == '\\')) {
|
||||
return get_string('pathslasherror') . '<br />';
|
||||
} else if (!empty($data) and !is_dir($data)) {
|
||||
$data = trim($data);
|
||||
if (!empty($data) and !is_dir($data)) {
|
||||
return get_string('pathnotexists') . '<br />';
|
||||
}
|
||||
return (backup_set_config($this->name, $data) ? '' : get_string('errorsetting', 'admin') . $this->visiblename . '<br />');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue