From: stronk7 Date: Sun, 10 Oct 2004 23:25:57 +0000 (+0000) Subject: Under Win32, we need backslashes in paths. Now it works!! X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=76dc1ad2cfce9f09a581d7161c84a118acc9c78c;p=moodle.git Under Win32, we need backslashes in paths. Now it works!! Merged from MOODLE_14_STABLE --- diff --git a/lib/moodlelib.php b/lib/moodlelib.php index eee5fbdef2..9816c70606 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -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); }