From 5e3ff5e157afa5beef2df7501ae522e8709ddc46 Mon Sep 17 00:00:00 2001 From: Ivan Tcholakov Date: Wed, 24 Feb 2010 23:45:00 +0200 Subject: [PATCH] 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. --- main/inc/lib/pclzip/pclzip.lib.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/main/inc/lib/pclzip/pclzip.lib.php b/main/inc/lib/pclzip/pclzip.lib.php index 2249fd5971..8ef0182975 100755 --- a/main/inc/lib/pclzip/pclzip.lib.php +++ b/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'] = '';