From e941292002e38d4b5945508c1611ba858d81435c Mon Sep 17 00:00:00 2001 From: stronk7 Date: Sun, 17 Oct 2004 13:36:13 +0000 Subject: [PATCH] Now pclzip generated files are compatible with info-zip (linux, macos x, win32, bsd...) based extractors. This include command-line flavours, stuffit and so on... Thanks to Petr!! We have to remember to apply this patch when we update the pclzip in th future (if their authors don't include it). Merged from MOODLE_14_STABLE --- lib/pclzip/pclzip.lib.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/pclzip/pclzip.lib.php b/lib/pclzip/pclzip.lib.php index e4db810ee4..c589a30bb5 100644 --- a/lib/pclzip/pclzip.lib.php +++ b/lib/pclzip/pclzip.lib.php @@ -2280,6 +2280,13 @@ } */ + //skodak's hack - store trailing slash for directories - for compatibility with info-zip + if(is_dir($p_filename)) { + if(strrpos($v_stored_filename, '/') != strlen($v_stored_filename)-1) { + $v_stored_filename = $v_stored_filename.'/'; + } + } + // ----- Set the file properties clearstatcache(); $p_header['version'] = 20; -- 2.39.5