MDL-7829 zipping with binary zip broken under windows when moodledata on different disk; backported from HEAD

This commit is contained in:
skodak
2006-12-29 22:53:35 +00:00
parent 152fa94009
commit bb52c312de
+8 -2
View File
@@ -6089,8 +6089,14 @@ function zip_files ($originalfiles, $destination) {
$filestozip .= " ";
}
//Construct the command
$separator = strtoupper(substr(PHP_OS, 0, 3)) === 'WIN' ? ' &' : ' ;';
$command = 'cd '.escapeshellarg($origpath).$separator.
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
$separator = ' &';
$command= substr($CFG->dataroot, 0, 2).$separator; // change to drive with moodledata
} else {
$separator = ' ;';
$command= '';
}
$command .= 'cd '.escapeshellarg($origpath).$separator.
escapeshellarg($CFG->zip).' -r '.
escapeshellarg(cleardoubleslashes("$destpath/$destfilename")).' '.$filestozip;
//All converted to backslashes in WIN