From 76dc1ad2cfce9f09a581d7161c84a118acc9c78c Mon Sep 17 00:00:00 2001 From: stronk7 Date: Sun, 10 Oct 2004 23:25:57 +0000 Subject: [PATCH] Under Win32, we need backslashes in paths. Now it works!! Merged from MOODLE_14_STABLE --- lib/moodlelib.php | 8 ++++++++ 1 file changed, 8 insertions(+) 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); } -- 2.39.5