]> git.mjollnir.org Git - moodle.git/commitdiff
Under Win32, we need backslashes in paths. Now it works!!
authorstronk7 <stronk7>
Sun, 10 Oct 2004 23:25:57 +0000 (23:25 +0000)
committerstronk7 <stronk7>
Sun, 10 Oct 2004 23:25:57 +0000 (23:25 +0000)
Merged from MOODLE_14_STABLE

lib/moodlelib.php

index eee5fbdef24a51ef7cf3b2a51b90d9e7ba2244b6..9816c70606b37dc7be8c6fb33e8f2ac01d9d63c1 100644 (file)
@@ -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);
     }