Bug #627 - Chamilo 1.8.7, PclZip 1.8.2 library: Applying a patch for compatibility of PclZip with some Windows-implemented archivers. Stored in an archive filenames with backslashes (Windows style) are interpreted correctly now.

skala
Ivan Tcholakov 16 years ago
parent 8bb39cc5ab
commit 5e3ff5e157
  1. 9
      main/inc/lib/pclzip/pclzip.lib.php

@ -4431,7 +4431,14 @@ if (!function_exists('gzopen') && function_exists('gzopen64')) {
// ----- Get filename
if ($p_header['filename_len'] != 0)
$p_header['filename'] = fread($this->zip_fd, $p_header['filename_len']);
//
// --------------------------------------------------------------------------------
// A patch about stored filenames with backslash directory separator (Windows style).
// Archives created by the utility IZArc 3.81 (possibly new versions too) need this patch.
//$p_header['filename'] = fread($this->zip_fd, $p_header['filename_len']);
$p_header['filename'] = str_replace("\\", '/', fread($this->zip_fd, $p_header['filename_len']));
// --------------------------------------------------------------------------------
//
else
$p_header['filename'] = '';

Loading…
Cancel
Save