]> git.mjollnir.org Git - moodle.git/commitdiff
Merge from MOODLE_14_STABLE
authormartinlanghoff <martinlanghoff>
Fri, 26 Nov 2004 00:57:58 +0000 (00:57 +0000)
committermartinlanghoff <martinlanghoff>
Fri, 26 Nov 2004 00:57:58 +0000 (00:57 +0000)
Fix for bug 2227 "bug in pclzip.php causing scorm errors"
http://moodle.org/bugs/bug.php?op=show&bugid=2227

Credits go to skodak

mod/scorm/details.php

index a49ebdeeee7d22932fff9573cbf24536389a9491..a9a5ee73aa7b282f0a4cd291d4d5648c7b73998b 100755 (executable)
     if ($scormdir = make_upload_directory("$course->id/$CFG->moddata/scorm")) {
         if ($tempdir = scorm_datadir($scormdir, $form->datadir)) {
             copy ("$coursedir/$form->reference", $tempdir."/".basename($form->reference));
-            if (empty($CFG->unzip)) {    // Use built-in php-based unzip function
-                include_once($CFG->dirroot.'/lib/pclzip/pclzip.lib.php');
-                $archive = new PclZip($tempdir."/".basename($form->reference));
-                if (!$list = $archive->extract($tempdir)) {
-                    error($archive->errorInfo(true));
-                }
-            } else {
-                $command = "cd $tempdir; $CFG->unzip -o ".basename($form->reference)." 2>&1";
-                exec($command);
-            }
+            unzip_file($tempdir."/".basename($form->reference), $tempdir, false);
             $result = scorm_validate($tempdir."/imsmanifest.xml");
         } else {
             $result = "packagedir";