diff --git a/files/index.php b/files/index.php index 20ea0f2f048..45409b4384f 100644 --- a/files/index.php +++ b/files/index.php @@ -399,42 +399,8 @@ $file = basename($file); - if (empty($CFG->unzip)) { // Use built-in php-based unzip function - include_once("$CFG->libdir/pclzip/pclzip.lib.php"); - $archive = new PclZip(cleardoubleslashes("$basedir/$wdir/$file")); - if (!$list = $archive->extract(PCLZIP_OPT_PATH, cleardoubleslashes("$basedir/$wdir"), - PCLZIP_CB_PRE_EXTRACT, 'approvefile')) { - error($archive->errorInfo(true)); - } else { // print some output - echo "
$strname | "; - echo "$strsize | "; - echo "$strmodified | "; - echo "$strstatus |
---|---|---|---|
"; - } - $filedate = userdate($item['mtime'], get_string("strftimedatetime")); - print_cell("right", $filedate); - print_cell("right", $item['status']); - echo " |
"; - $command = "cd $basedir/$wdir ; $CFG->unzip -o $file 2>&1"; - passthru($command); - echo ""; - print_simple_box_end(); + if (!unzip_file("$basedir/$wdir/$file")) { + error(get_string("unzipfileserror","error")); } echo "