From 711fb62bafa747009b45e0748b93e30bfdef5a02 Mon Sep 17 00:00:00 2001 From: skodak Date: Fri, 29 Dec 2006 22:52:01 +0000 Subject: [PATCH] MDL-7829 zipping with binary zip broken under windows when moodledata on different disk --- lib/moodlelib.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/moodlelib.php b/lib/moodlelib.php index 2c06dcc382..7b9825684c 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -6075,8 +6075,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 -- 2.39.5