mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 14:27:22 +01:00
Under Win32, we need backslashes in paths. Now it works!!
Merged from MOODLE_14_STABLE
This commit is contained in:
parent
6cf2fe0336
commit
76dc1ad2cf
@ -4296,6 +4296,10 @@ function zip_files ($originalfiles, $destination) {
|
||||
$command = 'cd '.escapeshellarg($origpath).$separator.
|
||||
escapeshellarg($CFG->zip).' -r '.
|
||||
escapeshellarg(cleardoubleslashes("$destpath/$destfilename")).' '.$filestozip;
|
||||
//All converted to backslashes in WIN
|
||||
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
|
||||
$command = str_replace('/','\\',$command);
|
||||
}
|
||||
Exec($command);
|
||||
}
|
||||
return true;
|
||||
@ -4364,6 +4368,10 @@ function unzip_file ($zipfile, $destination = '') {
|
||||
escapeshellarg($CFG->unzip).' -o '.
|
||||
escapeshellarg(cleardoubleslashes("$zippath/$zipfilename")).' -d '.
|
||||
escapeshellarg($destpath).$redirection;
|
||||
//All converted to backslashes in WIN
|
||||
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
|
||||
$command = str_replace('/','\\',$command);
|
||||
}
|
||||
Exec($command,$list);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user