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