]> git.mjollnir.org Git - moodle.git/commitdiff
Now pclzip generated files are compatible with info-zip
authorstronk7 <stronk7>
Sun, 17 Oct 2004 13:36:13 +0000 (13:36 +0000)
committerstronk7 <stronk7>
Sun, 17 Oct 2004 13:36:13 +0000 (13:36 +0000)
(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

index e4db810ee41b554754d3dd912b000b63c766cdde..c589a30bb50d13415a3e7b3493f41cbbdc8685d9 100644 (file)
     }\r
     */\r
 \r
+    //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\r
     clearstatcache();\r
     $p_header['version'] = 20;\r