From: stronk7 Date: Sun, 17 Oct 2004 13:36:13 +0000 (+0000) Subject: Now pclzip generated files are compatible with info-zip X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=e941292002e38d4b5945508c1611ba858d81435c;p=moodle.git 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 --- 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;