mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
MDL-37780 fix 1.9 restore on windows
This commit is contained in:
parent
6c413970b7
commit
d4eb62d66b
1 changed files with 7 additions and 3 deletions
|
@ -1210,12 +1210,16 @@ class moodle1_file_manager implements loggable {
|
|||
*/
|
||||
public function migrate_file($sourcepath, $filepath = '/', $filename = null, $sortorder = 0, $timecreated = null, $timemodified = null) {
|
||||
|
||||
$sourcefullpath = $this->basepath.'/'.$sourcepath;
|
||||
// Normalise Windows paths a bit.
|
||||
$sourcepath = str_replace('\\', '/', $sourcepath);
|
||||
|
||||
if ($sourcefullpath !== clean_param($sourcefullpath, PARAM_PATH)) {
|
||||
throw new moodle1_convert_exception('file_invalid_path', $sourcefullpath);
|
||||
// PARAM_PATH must not be used on full OS path!
|
||||
if ($sourcepath !== clean_param($sourcepath, PARAM_PATH)) {
|
||||
throw new moodle1_convert_exception('file_invalid_path', $sourcepath);
|
||||
}
|
||||
|
||||
$sourcefullpath = $this->basepath.'/'.$sourcepath;
|
||||
|
||||
if (!is_readable($sourcefullpath)) {
|
||||
throw new moodle1_convert_exception('file_not_readable', $sourcefullpath);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue